Does anyone have a PowerShell script to create a custom security role?
I'm getting closer...
I created a 'Security Role' in my lab with all the settings I need and exported the role to an XML file.
Then I used the 'Import-CMSecurityRole -XmlFileName' to import the security role.
Then I use 'New-CMAdministrativeUser...' to create the new user with my custom role and assign Collections and Security Scopes to it.
I'm using 'New-CMSecurityScope...' to create a new securitry scope.
The piece I'm missing is how to add the security scope to objects programatically.
I want to avoid the SCCM Admin from having to add the Security Scope to objects manually through the SCCM Admin console.
Does anyone know of a way to to add a Security Scope to objects via a script/powershell?