Popular Posts

Tuesday, October 24, 2017

How to add a Domain Group into local administrator group in one line


Run from PowerShell:


([ADSI]"WinNT://./Administrators").PSBase.Invoke("Add",([ADSI]"WinNT://my.domain.net/adc_win_defaultadmins").PSBase.Path)


or from CMD:

PowerShell -command "& {([ADSI]'WinNT://./Administrators').PSBase.Invoke('Add',([ADSI]'WinNT://my.domain.net/adc_win_defaultadmins').PSBase.Path)}"

No comments:

Post a Comment