Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

Agent doesn't execute 64 bits PS scripts


I have installed OCS UNIX server 2.7 on a debian 10.4 and it is working fine. Now I'm trying to make the plugin "Winusers v2.2" work but to no avail.

On Windows 10 machines (multiple ones), the agent (v, launchs the plugin's PowerShell script in 32 bits which prevent some PS commands from executing (namely Get-LocalUser and Get-LocalGroupMember).

How do I know that?

- The script works fine when I execute it locally from a PS console;

- When the agent executes it, I get the error "get-localuser' is not recognized as the name of a cmdlet" in the logs of the plugin;

- When I replace "Get-localuser" by a somewhat similar command "Get-WmiObject -ComputerName localhost -Class Win32_UserAccount", I get the same error as above but this time for Get-LocalGroupMember (not recognized as the name of a cmdlet);

- When I replace Get-LocalGroupMember by a somewhat similar command (gwmi win32_group -computername localhost -filter 'Name = "Administrateurs"'), the script runs correctly and I see a list of users on the computer page on the administration server;

- Microsoft documentation for both commands states explicitely that they run exclusively in 64 bits mode.

So is the agent really the culprit and is there a way to make it run the scripts in 64 bits?

Or am I doing something wrong elsewhere?

NB. My workaround may be satisfactory for some cases but not in mine (at least not in the present state).

in OCS Inventory NG agent for Windows by (230 points)

1 Answer

0 votes
My bad : the version of the agent solved the issue (which still makes me wonder how the plugin managed to work before...)
by (230 points)
Powered by Question2Answer