Howto: Back up Server 2003 Users Groups Shares Permissions Program Names Network Settings

September 20, 2010

I cam across two amazing article the other day detailing how to do some great stuff from the windows command line.

synjunkie knows his shit:

I stumbled upon it because I was about to format a server but wanted to retain this information:

  • All local groups/users and their respective permissions for various folders the server was sharing
  • What rights Domain users had to local groups/shares
  • Current TCP/IP configuration
  • hosts file content
  • All contents of “program files”
  • All installed programs
  • Complete list of services

Here’s the .bat file for your enjoyment
mkdir c:\1serverinfo
cd ..
cd \
cd \
cd ..
cd 1serverinfo
copy "C:\Program Files\Windows Resource Kits\Tools\" %SYSTEMROOT%\system32
ipconfig /all > ipconfig.txt
net share > net_share.txt
net start > net_start.txt
tree "C:\Program Files" > program_files.txt
tree "C:\Program Files (x86)" > program_filesx86.txt
srvcheck \\%COMPUTERNAME% > shares.txt
net localgroup Administrators > administrators.txt
net localgroup "Remote Desktop Users" > remote_desktop_users.txt
type %SYSTEMROOT%\SYSTEM32\DRIVERS\etc\HOSTS > hosts.txt
wmic share list /format:hform > share_wmic.html
wmic group list full /format:hform >groups.html
wmic useraccount list full /format:hform>users.html
wmic nicconfig get description, ipaddress /format:htable >nic_addresses.html
wmic process list full /format:htable > processes.html
wmic product > product.txt
wmic service list full /format:htable >service.html
wmic qfe list full /format:htable > qfe.html
wmic startup list full /format:htable > startup.html
%SystemRoot%\explorer.exe /e,c:\1server_info

You’ll need the Windows Server 2003 Resource Kit Tools

Note:  In this example I had installed the Windows Resource Kit to “C:\Program Files\Windows Resource Kits\Tools\”

Thank you synjunkie!