Thursday, January 7, 2010

Check admin$ share using PowerShell

Here is a PowerShell script which you can use to test the admin$ share access.  This script is useful when you are performing computer migrations.  You can use a CSV file as an input file. 


This script generates 3 output files; Success_Computers.txtFailed_Computers.txt and UserNames.txt

Here is the Input.CSV file format:




Usage: Add all computer names to the Input.CSV file and run the PreMig.PS1 script.

Download: You can download the script from this location.


How do I change the script to get to the computers at the old domain?

Also, not to be critical; your script is great - but you make a lot of assumptions by not explaining what changes need to be made to accommodate ones environment.

What do you mean by “old domain”? You can run this script from any domain.

Thanks for the feedback. However, you need to explain your requirements. Any scripts can be modified to accurate any environment.

You see you just answered my question. "What do you mean by “old domain”? You can run this script from any domain."

I wasn't sure if I needed to run this from the target domain, and make the necessary changes in the script. Now I know I can run it from the source domain. I know I should have figured this out, but it gets frustrating when technical professionals makes too many assumptions.
Again, I'm not trying to be critical.
Do you have VBS script or something that I can get the computers associated with the users?

Technical professionals have to make assumptions. Otherwise they won't be able to come up with a “generic” script like this :)

Regarding your “computers associated with the users” question, you can use different methods. Here is an example using profile LastAccessTime.

Hi Santhosh,

Ping (part of PreMig1 Script)– Make sure you can ping the workstation from the migration?

Where is that command?

Ping is not included in this script. My assumption is that if you can access admin$ you should be able to access the computer without any issues.

Also, most of the customers are not allowing ICMP on their network these days.

I have another script on this site which includes Ping and admin$

Hi Santhosh,
I have few windows 2k3 and 2k8R2 servers and I have common Local admin account,I wanted to check in all server whether the Local admin account is able to log in or not ,how can I check this? The user name and passowrd is same for all the servers and I have created an excel sheet with Hostname~ IP~ user name~Password; I wanted to know whether it able to login to all the servers or not,if not able to login; an output file could be genreated by scipt and should proivde the server list which are denied the access,is it possible to have a script for this??
the way few people suggested me login to all servers and check ,but i dotn think it is going to be good choice as I have server in count of hundereds.

Please help with your suggestion

This comment has been removed by the author.

Mesmerized article written on this blog with other relevant information. It is straight to the point that how we can improve our skills as well as how we can be represented to a new stream of professionalism. Upgrade windows 10 home to pro key

I'm having issues with migrating Computers in Server 2012 R2 domain. I've found articles saying this could be due to DNS or not being able to have duplicate SPN's. Is there an easy workaround?

Post a Comment

Popular Posts


Twitter Delicious Facebook Digg Stumbleupon Favorites More