Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzFilesHybrid Powershell Module - PSRemote session cannot run the module #130

Open
Azure-hacker opened this issue Nov 28, 2022 · 0 comments

Comments

@Azure-hacker
Copy link

We are trying to automate the Azure File share Domain join, using Azure YML Pipelines.
We are currently hitting an issue with the AzFilesHybrid PowerShell Module, when running the command: Join-AzStorageaccountForAuth from either a PS remote session or through the ADO task: PowershellonTargetMachine@3 (Same error).
PS: We have tested the module directly inside the VM, and it is working.

The error is the following:

error with az filehybrid module

lines from module

We have identified that the following command: Get-ADDomain, from the line 2398 of the module, is failing (Same error above) from a PS Remote Session, but when we use “-server “ parameter, if you run the command (Get-ADDomain) from a PS Remote Session, it works. (At least this is what we have found during our troubleshooting)

• When we run the command with -server from PSRemoteSession:
Invoke-Command -Session $s -ScriptBlock {Get-ADDomain -server -Credential domain\admin}: working

• When we run the command without -server from PSRemoteSession:
Invoke-Command -Session $s -ScriptBlock {Get-ADDomain -Credential domain\admin} : not working

• When we run the module from VM Hybrid Worker: working

PS: All prerequisites needed to run the module as well as WinRM are valid and available in the VM.

Could you please help me explain this behavior, as well as any alternatives / workaround for this issue, (as updating the module would not be an option) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant