Import-Role
Imports (deserializes) Sitecore roles from the Sitecore server filesystem.

Syntax

Import-Role [-Identity] <AccountIdentity> [-Root <String>]
Import-Role -Filter <String> [-Root <String>]
Import-Role [-Role] <User> [-Root <String>]
Import-Role -Path <String>

Detailed Description

The Import-Role command imports (deserializes) Sitecore roles from the Sitecore server filesystem.
© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions

Parameters

-Identity <AccountIdentity>

Specifies the Sitecore role to be deserialized by providing one of the following values.
1
Local Name
2
Example: developer
3
Fully Qualified Name
4
Example: sitecore\developer
Copied!
Aliases
​
Required?
true
Position?
1
Default Value
​
Accept Pipeline Input?
true (ByValue)
Accept Wildcard Characters?
false

-Filter <String>

Specifies a simple pattern to match Sitecore roles.
Examples: The following examples show how to use the filter syntax.
To get all the roles, use the asterisk wildcard: Import-Role -Filter *
To get all the roles in a domain use the following command: Import-Role -Filter "sitecore*"
Aliases
​
Required?
true
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Role <User>

An existing role object to be restored to the version from disk
Aliases
​
Required?
true
Position?
1
Default Value
​
Accept Pipeline Input?
true (ByValue)
Accept Wildcard Characters?
false

-Path <String>

Path to the file the role should be loaded from.
Aliases
​
Required?
true
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Root <String>

Specifies the serialization root directory. If this parameter is not specified - the default Sitecore serialization folder will be used (unless you're reading from an explicit location with the -Path parameter).
Aliases
​
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.
  • System.String
    Sitecore.Security.Accounts.Role

Notes

Help Author: Adam Najmanowicz, Michael West

Examples

EXAMPLE 1

1
PS master:\> Import-Role -Identity sitecore\Author
Copied!

EXAMPLE 2

1
PS master:\> Import-Role -Filter sitecore\*
Copied!

EXAMPLE 3

1
PS master:\> Import-Role -Root C:\my\Serialization\Folder\ -Filter *\*
Copied!

EXAMPLE 4

1
PS master:\> Import-Role -Path C:\my\Serialization\Folder\Admins.role
Copied!

Related Topics

Last modified 2yr ago