Как я могу сделать себя администратором на моем ПК, используя powershell?
Исключение:
Cannot find group name
+ $AdminGroup.Add($InUser.Path)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], ExtendedTypeSystemException
+ FullyQualifiedErrorId : CatchFromBaseGetMember
$User = $env:USERNAME
$HostName = $env:COMPUTERNAME
$DomainName = "xxxx"
$AdminGroup = [ADSI]"WinNT://$HostName/administrators,group"
$InUser = [ADSI]"WinNT://$DomainName/$User,user"
$AdminGroup.Add($InUser.Path)