Category Archives: Cmdlets&Tools

repair file and folder permission is corrupt

today find my windows 10 10130 is fail to boot on due to the double boot windows 8.1 repair the windows 10 disk and repaired the disk which has no issue and in the end the whole windows 10 disk can not be accessed.

after try manually GUI fix the folder and file permissions it does not help too much (Take Ownership And Grant Permissions To Access Files & Folders).

While after some research, the cmdlet tools helps

takeown /f e:\* /R /A

icacls E:\* /grant administrators:(F) /inheritance:e /t

it is much faster than the gui operation.


check remote server administrator group members

this is a vbs.

Dim objGroup, strComputer
strComputer = "xy-PC"
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
Wscript.Echo "Members of local Administrators group on computer " & strComputer
Call EnumGroup(objGroup, "")

Sub EnumGroup(objGroup, strOffset)
Dim objMember
For Each objMember In objGroup.Members
Wscript.Echo strOffset & objMember.Name & " (" & objMember.Class & ")"
If (objMember.Class = "Group") Then
Call EnumGroup(objMember, strOffset & "–")
End If
End Sub

Leave a comment

Posted by on October 25, 2010 in Cmdlets&Tools


query local administrators group member list

query local administrators group member list should be a very common task for daily administration. here is a method using WMIC remote Call due to it is shipped with Windows XP and Windows 2003.


wmic /node:”03r2″ /user:administrator /password:P@ssw0rd path win32_groupuser where (groupcomponent = ‘”administrators”,domain=”03r2″‘)

wmic /node:”″ /user:administrator /password:P@ssw0rd path win32_groupuser where (groupcomponent = ‘”administrators”,domain=”03r2″‘)

change green string to the real pc’s netbios name or IP(recommend)



wmic in Windows 5.x is a little different from Windows 6.x. you can try below code which is query local administrators group member ship. It  can success get result in Windows 7 but failed on windows XP or 2003.

wmic path win32_groupuser where (groupcomponent=””\administrators\”,domain=\”%computername%\””)


Posted by on October 9, 2010 in Cmdlets&Tools



get user sid

1- powershell

gwmi win32_useraccount | ? {$ -eq “xy”}

PS C:\Users\xy> gwmi win32_useraccount | ? {$ -eq “xy”}

AccountType : 512
Caption     : xy-PC\xy
Domain      : xy-PC
SID         : S-1-5-21-1248425971-3961186720-2772201540-1000
FullName    :
Name        : xy


whoami /user /fo list


User Name SID
========= ==============================================
xy-pc\xy  S-1-5-21-1248425971-3961186720-2772201540-1000

Leave a comment

Posted by on October 8, 2010 in Cmdlets&Tools


Tags: ,


:\Windows\System32>subst /?
Associates a path with a drive letter.

SUBST [drive1: [drive2:]path]
SUBST drive1: /D

  drive1:        Specifies a virtual drive to which you want to assign a path.
  [drive2:]path  Specifies a physical drive and path you want to assign to  a virtual drive.
  /D             Deletes a substituted (virtual) drive.

Type SUBST with no parameters to display a list of current virtual drives.

Leave a comment

Posted by on September 2, 2010 in Cmdlets&Tools



Lockout fixer

AD Account lockout issue must be a common issue and most SA will feel boiling about it. here is an very useful tool for this.

download it from


hope helps.



get installed patch list on the local computer

powershell:Get-WmiObject -Query ‘select * from Win32_QuickFixEngineering’ | ? {$_.installedon -like “*2010” } |sort installedon -descending | ft hotfixid,installedon

WMIC(shipped with windows by default)

wmic qfe get description,HotFixID,InstalledOn | findstr -i “2010”

Leave a comment

Posted by on June 12, 2010 in Cmdlets&Tools


Tags: ,

%d bloggers like this: