Файловый менеджер - Редактировать - /var/opt/nydus/ops/customer_local_ops/operating_system/powershell/add_user_to_group.ps1
Назад
param([Parameter(Mandatory)] [String] $userName, [Parameter(Mandatory)] [String] $groupName) if(Get-WmiObject -query "SELECT * FROM Win32_UserAccount where LocalAccount='True' and name = '$userName'"){ $user = [ADSI]"WinNT://$($env:COMPUTERNAME)/$userName,user" $computer = [ADSI]("WinNT://$($env:COMPUTERNAME),computer") $admins = $computer.psbase.children.find('Administrators') $members = $admins.psbase.invoke('Members') | %{$_.GetType().InvokeMember('Name', 'GetProperty', $null, $_, $null)} if($members -contains $userName){ }else{ $group = [ADSI]"WinNT://$($env:COMPUTERNAME)/$groupName,group" try{ $group.psbase.Invoke("Add",([ADSI]"WinNT://$($env:COMPUTERNAME)/$userName").path) }catch{ $_.Exception.Message } } }else{ "User does not exist: $userName" exit 1 }
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка