powershell - Configuring "Do not forcefully unload the users registry at user logoff" in User Profiles of Group Policy editor -


i need write powershell script should configure below settings of group policy in machines.

gpedit.msc → computer configuration → administrative templates → system → user profiles → "do not forcefully unload users registry @ user logoff" "enabled".

as aware can done using registry value also

[hkey_local_machine\software\policies\microsoft\windows\system] "disableforceunload"=dword:00000001 

but through script, when add required registry entry, change not reflected in group policy console. of course, need use group policy cmdlets! when tried set-gpregistryvalue below statement

set-gpregistryvalue -name "user profiles" `   -key "hklm\software\policies\microsoft\windows\system\" `   -valuename disableforceunload -type dword -value 1 

it shows exception saying "a referral returned server."

set-gpregistryvalue : referral returned server. (exception hresult: 0x8007202b) @ d:\work\xyz\desktop\gpo1.ps1:6 char:1 + set-gpregistryvalue -name "user profiles" -key "hklm\sof ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + categoryinfo          : notspecified: (:) [set-gpregistryvalue], comexception     + fullyqualifiederrorid : system.runtime.interopservices.comexception,microsoft.grouppolicy.commands.setgpregistryvalue     command 

what missing out here?

a domain controller returning referral means object present in directory, not on particular domain controller. can happen instance partitioned directories or trusted/child domains.

you can use -domain , -server parameters connecting specific domain and/or server. default connect pdc emulator of domain of current user.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -