# Set-WmiNamespaceSecurity-ps1 + Account not found

**URL:** <https://forum.ansible.com/t/set-wminamespacesecurity-ps1-account-not-found/37962>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [May 4, 2023, 10:11am UTC](https://forum.ansible.com/t/set-wminamespacesecurity-ps1-account-not-found/37962 "2023-05-04T10:11:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Veliss](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@John\_Veliss](https://forum.ansible.com/u/John_Veliss)\
**Post date:** [May 4, 2023, 10:11am UTC](https://forum.ansible.com/t/set-wminamespacesecurity-ps1-account-not-found/37962/1 "2023-05-04T10:11:19Z")

</div>

Hello,

I am trying to run a PS script using win\_shell modules  
The name of the script is called Set-WmiNamespaceSecurity-ps1  
[https://github.com/grbray/PowerShell/blob/main/Windows/Set-WMINameSpaceSecurity.ps1](https://github.com/grbray/PowerShell/blob/main/Windows/Set-WMINameSpaceSecurity.ps1)

When I run the command from the command line, it runs fine with no issues.

When I copy the script to a remote host and try to run using ansibles win\_shell, I always have errors in regards to “Account was not found”

The syntax of my win\_shell command is as below

win\_shell: .\Set-WmiNamespaceSecurity.ps1 -namespace root -operation add -account ‘user@domain’ Enable,RemoteAccess,Methodexecute

or

win\_shell: .\Set-WmiNamespaceSecurity.ps1 -namespace root -operation add -account ‘domain\user’ Enable,RemoteAccess,Methodexecute

I have tried both domain\username and also username@domain but still getting “Account was not found” errors.

I think it may have something to do with the PS script, but if anyone can shed any light, that would be much appreciated.

Thanks
