I add a new local user using opsi conf manager, but I'm trying now to delete it with the scrypt and I could not find the problem. I hope anyone will help me. Here is the code that I used:
Code: Alles auswählen
[Actions]
DefVar $username$
DefVar $fullname$
DefVar $password$
DefVar $isAdmin$
DefVar $syslanguage$
Set $username$ = GetProductProperty("user_name", "Test")
Set $fullname$ = GetProductProperty("user_fullname", "Test")
Set $password$ = GetProductProperty("password", "test")
Set $isAdmin$ = GetProductProperty("is_admin", "true")
Set $syslanguage$ = GetRegistryStringValue("[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Nls\Language] Default")
Message "Adding user to local machine"
winbatch_deluser
[winbatch_deluser]
if ($isAdmin$ = "true")
net user $username$ $password$ /del /passwordreq:yes /fullname:"$fullname$"
if ($syslanguage$ = "0816")
net localgroup Administradores $username$ /del
else
net localgroup Administrators $username$ /del
endif
else
net user $username$ $password$ /del /passwordreq:yes /fullname:"$fullname$"
Code: Alles auswählen
[Actions]
DefVar $Value$
DefVar $isAdmin$
DefVar $Path$
Set $username$ = GetProductProperty("user_name", "Test")
Set $Value$= GetProductProperty("background.jpg")
Set $isAdmin$ = GetProductProperty("is_admin", "true")
Set $Path$=Set-ItemProperty('HKCU:\Control Panel\Desktop\')