/build/static/layout/Breadcrumb_cap_w.png

How deploy a script to add "domain users" in local group ?

Hi,

I would like to deploy a script to add "domain users" group in local group.
I tried everything to deploy.

It's working in local but not with Kace, i don't know why.

I tried also to disable UAC
I tried "run as" with
-system local
-domain admin

Here are my scripts :

Batch:
net localgroup "group" /add
net localgroup "group" "domain\domain users" /add


Powershell:
New-LocalGroup -Name "group"
$DomainGroup = "domain users"
$LocalGroup  = "group"
$Computer    = $env:computername
$Domain      = $env:userdomain
([ADSI]"WinNT://$Computer/$LocalGroup,group").psbase.Invoke("Add",([ADSI]"WinNT://$Domain/$DomainGroup").path)


Maybe someone get the answer

Thank you


0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ