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. 

image

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

Here is the Input.CSV file format:

image

Output:

image

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.

14 comments:

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.

http://portal.sivarajan.com/2010/07/user-profile-and-os-info-powershell.html

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.

Post a Comment

Popular Posts

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More