VBS Script To Verify If The Admin$ Share Exist On A Remote Machine

 

This VBS script will allow you to verify if the Admin$ share is accessible and exist on a remote machine.

 

VBS Script:

 

strComputer = InputBox ("Enter Machine Name")

 

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colShares = objWMIService.ExecQuery("Select * from Win32_Share Where Name = 'Admin$'")

 

If colShares.Count = 0 Then

MsgBox "Admin$ Does Not Exist On: " & UCase(strComputer)

Else

MsgBox "Admin$ Exist On: " &  UCase(strComputer)

End If

 

 

Published Sunday, November 25, 2007 6:58 AM by dhite
Filed under:

Comments

No Comments