Open lazywinadmin opened 8 years ago
There is maybe a way by using the GPMC assemblies, example:
$assembly=[reflection.assembly]::Load("Microsoft.GroupPolicy.Management, Version=2.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35")
$domain = new-object Microsoft.GroupPolicy.GPDomain
$domain.GetAllGpos()
More about the namespace: Microsoft.GroupPolicy namespace
Thanks @MickyBalladelli ! Yeah I guess I could take this approach I was just hoping i could rely on .net
Is there anyway to retrieve Group policy objects, Links, permissions, using .NET ?
I already have some basic code here Get-ADSIGroupPolicyObject but it is far from perfect.
I would like to have the same approach as Get-ADSIUser, that I'm reusing in Remove-ADSIUser, Unlock-ADSIUser, Enable-ADSIUSer, Disable-ADSIUser