你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Remove-AzureStorSimpleStorageAccountCredential

删除现有的存储帐户凭据。

注意

本文档中引用的 cmdlet 用于管理使用 Azure Service Manager (ASM) API 的旧 Azure 资源。 创建新的资源时,不建议使用此旧版 PowerShell 模块,因为 ASM 计划停用。 有关详细信息,请参阅 Azure Service Manager 停用

Az PowerShell 模块是推荐的 PowerShell 模块,用于使用 PowerShell 管理 Azure 资源管理器 (ARM) 资源。

语法

Remove-AzureStorSimpleStorageAccountCredential
      -StorageAccountName <String>
      [-WaitForComplete]
      [-Force]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]
Remove-AzureStorSimpleStorageAccountCredential
      -SAC <StorageAccountCredentialResponse>
      [-WaitForComplete]
      [-Force]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]

说明

Remove-AzureStorSimpleStorageAccountCredential cmdlet 删除现有的存储帐户凭据。 按名称指定帐户,或使用 Get-AzureStorSimpleStorageAccountCredential cmdlet 获取要删除的 StorageAccountCredential 对象。

示例

示例 1:删除存储帐户凭据

PS C:\>Remove-AzureStorSimpleStorageAccountCredential -StorageAccountName "ContosoStorage07" -Force
VERBOSE: ClientRequestId: 8e10d56b-ddb1-459b-b26e-a185f5a303de_PS
VERBOSE: About to create a job to remove your Storage Access Credential! 
VERBOSE: ClientRequestId: 55cb6296-0156-4266-8591-d9e9bf8cc584_PS
982f4b19-ccb0-4ad3-9b02-f8ad25bf2e72
VERBOSE: The delete task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
982f4b19-ccb0-4ad3-9b02-f8ad25bf2e72 for tracking the task's status

此命令删除名为 ContosoStorage07 的存储帐户的帐户凭据。 此命令指定 Force 参数。 该 cmdlet 无需提示确认即可删除凭据。

示例 2:使用管道操作员删除存储帐户凭据

PS C:\>Get-AzureStorSimpleStorageAccountCredential -StorageAccountName "ContosoStorage07" | Remove-AzureStorSimpleStorageAccountCredential -Force -WaitForComplete
VERBOSE: ClientRequestId: f1b46216-bf4c-4c19-8e92-1dfe3894e258_PS
VERBOSE: ClientRequestId: 0d946f8f-c771-4ade-8a83-7c08dad86c52_PS
VERBOSE: ClientRequestId: 2000bab6-8311-4192-ad12-c67e35fc2697_PS
VERBOSE: Storage Access Credential with name ContosoStorage07 found! 
VERBOSE: About to run a job to remove your Storage Access Credential! 
VERBOSE: ClientRequestId: b803b165-bef8-4a8f-9509-4b515ea8bdec_PS
VERBOSE: Your delete operation completed successfully!

此命令使用 Get-AzureStorSimpleStorageAccountCredential cmdlet 获取名为 ContosoStorage07 的存储帐户,然后将该对象传递给当前 cmdlet。 当前 cmdlet 删除该存储帐户的凭据。 此命令指定 WaitForComplete 参数。 该 cmdlet 在完成删除操作之前不会将控制权返回到控制台。

参数

-Force

指示此 cmdlet 不会提示你进行确认。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-Profile

指定 Azure 配置文件。

类型:AzureSMProfile
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-SAC

将凭据指定为要删除的 StorageAccountCredential 对象。 若要获取 StorageAccountCredential 对象,请使用 Get-AzureStorSimpleStorageAccountCredential cmdlet。

类型:StorageAccountCredentialResponse
Position:Named
默认值:None
必需:True
Accept pipeline input:True
Accept wildcard characters:False

-StorageAccountName

指定要删除的存储帐户凭据的名称。

类型:String
Aliases:Name
Position:Named
默认值:None
必需:True
Accept pipeline input:False
Accept wildcard characters:False

-WaitForComplete

指示此 cmdlet 等待操作完成,然后再将控制权返回到 Windows PowerShell 控制台。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

输入

StorageAccountCredential

此 cmdlet 使用管道接受 StorageAccountCredential 对象。

输出

TaskStatusInfo

如果指定 WaitForComplete 参数,此 cmdlet 将返回 TaskStatusInfo 对象。