We have recently acquired a small firm having 1500 servers on which our team doesn't has access as of now although they are in domain. We need to find out how many servers are running Windows 2k3 and how many are Windows 2k8. I know the RDP screen of both of these versions are different , for example: if we RDP a Win2k3 machine, it gives a warning notice first and once we click Ok, it takes us to the credentials screen , but in case of Win2k8, it directly takes us to Crendentials which is a proof of the OS on the server. Doing this manually for 1500 servers is a time consuming task. Can we implement this RDP screen logic using a script to find out the Windows OS version.
I can imagine an Algorithm something like that:
- Enter server name.
- Invoke
mstsc
for that server - Verify if the dialogue box is a direct prompt for credentials or not?
- If so, print Windows 2k8, else 2k3/2k.
If this logic successful on one server, I can use it in a foreach
loop for all servers and export in in Excel.