azure-files-samples icon indicating copy to clipboard operation
azure-files-samples copied to clipboard

Update-AzStorageAccountADObjectPassword: Exception calling "ShouldProcess" with "3" argument(s): "Object reference not set to an instance of an object."

Open maddewac opened this issue 2 years ago • 2 comments

Using v0.2.7 Running in PowerShell 7.3.6

Join-AzStorageAccountForAuth `
    -ResourceGroupName $resourceGroupName `
    -StorageAccountName $storageAccountName `
    -Domain $domain  `
    -DomainAccountType "ComputerAccount"  `
    -OrganizationalUnitDistinguishedName $ouDistinguishedName `
    -OverwriteExistingADObject `
    -EncryptionType "AES256" `
    -SamAccountName $samAccountName `
    -Verbose `
    -ErrorAction Stop
Update-AzStorageAccountADObjectPassword: Exception calling "ShouldProcess" with "3" argument(s): "Object reference not set to an instance of an object."
    + CategoryInfo          : NotSpecified: (Update-A...an object.":String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
    + PSComputerName        : localhost

maddewac avatar Jul 14 '23 13:07 maddewac

I'm getting something similar when trying to execute this via a pipeline

16:00:38 Info | System.Management.Automation.MethodInvocationException: Exception calling "ShouldProcess" with "3" argument(s): "Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available." ---> System.Management.Automation.PSInvalidOperationException: Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available. 16:00:38 Info | at Microsoft.PowerShell.ConsoleHostUserInterface.HandleThrowOnReadAndPrompt() 16:00:38 Info | at Microsoft.PowerShell.ConsoleHostUserInterface.PromptForChoice(String caption, String message, Collection`1 choices, Int32 defaultChoice)

I've noticed that a dialogue is shown when run interactively

@madde-g are you running interactively???

I'm not sure how I can get this to automatically accept

image

a8ree avatar Jul 18 '23 16:07 a8ree

@a8ree I am not

maddewac avatar Jul 19 '23 05:07 maddewac