How to access Local Security Policy using c#
-
I want to access Local Security Policy (User Rights assignment) using C#. Is it possible? My requirement is to add/remove users from certain policies programatically. Thanks, Pranav
-
I want to access Local Security Policy (User Rights assignment) using C#. Is it possible? My requirement is to add/remove users from certain policies programatically. Thanks, Pranav
One Post is Enough.
Regards, Satips.
-
I want to access Local Security Policy (User Rights assignment) using C#. Is it possible? My requirement is to add/remove users from certain policies programatically. Thanks, Pranav
I think you should use IEnumerator iHeirarchy = SecurityManager.PolicyHierarchy(); then you can loop each policy level PolicyLevel polLevel = iHeirarchy.Current as PolicyLevel; and then you can get the codegroup by taking polLevel.RootCodeGroup.Children or get the named permission set polLevel.NamedPermissionSets from here you can manipulate whatever you wan't like removing or adding.
-
I think you should use IEnumerator iHeirarchy = SecurityManager.PolicyHierarchy(); then you can loop each policy level PolicyLevel polLevel = iHeirarchy.Current as PolicyLevel; and then you can get the codegroup by taking polLevel.RootCodeGroup.Children or get the named permission set polLevel.NamedPermissionSets from here you can manipulate whatever you wan't like removing or adding.
Thanks a ton! Pranav