Get-AzStorageLocalUser
Gets a specified local user or lists all local users in a storage account.
Syntax
AccountName (Default)
Get-AzStorageLocalUser
[-ResourceGroupName] <String>
[-StorageAccountName] <String>
[-UserName <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
AccountObject
Get-AzStorageLocalUser
-StorageAccount <PSStorageAccount>
[-UserName <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzStorageLocalUser cmdlet gets a specified local user or lists all local users in a storage account.
Examples
Example 1: Get a specified local user
$localUser = Get-AzStorageLocalUser -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -UserName testuser1
$localUser
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount
Name Sid HomeDirectory HasSharedKey HasSshKey HasSshPassword PermissionScopes
---- --- ------------- ------------ --------- -------------- ----------------
testuser1 S-1-2-0-0000000000-000000000-0000000000-0000 / True True True [container1,...]
$localUser.PermissionScopes
Permissions Service ResourceName
----------- ------- ------------
rw blob container1
rw file share2
This command gets a specified local user, and show the properties of it.
Example 2: List all local users in a storage account
Get-AzStorageLocalUser -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount"
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount
Name Sid HomeDirectory HasSharedKey HasSshKey HasSshPassword PermissionScopes SshAuthorizedKeys
---- --- ------------- ------------ --------- -------------- ---------------- -----------------
testuser1 S-1-2-0-0000000000-000000000-0000000000-0000 / True True True [container1,...]
testuser2 S-1-2-0-0000000000-000000000-0000000000-0002 /dir True True False
This command lists all local users in a storage account.
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ResourceGroupName
Resource Group Name.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
AccountName
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-StorageAccount
Storage account object
Parameter properties
| Type: | PSStorageAccount |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
AccountObject
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-StorageAccountName
Storage Account Name.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AccountName |
Parameter sets
AccountName
| Position: | 1 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-UserName
The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | Name |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.