Get-AzStorageLocalUser
Gets a specified local user or lists all local users in a storage account.
Syntax
Get-AzStorageLocalUser
[-ResourceGroupName] <String>
[-StorageAccountName] <String>
[-UserName <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
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.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResourceGroupName
Resource Group Name.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StorageAccount
Storage account object
Type: | PSStorageAccount |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-StorageAccountName
Storage Account Name.
Type: | String |
Aliases: | AccountName |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | String |
Aliases: | Name |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Outputs
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Azure PowerShell