/build/static/layout/Breadcrumb_cap_w.png

Display if a local user is enabled or disabled

I'm trying to create a custom inventory rule to display the local users and their enabled status and then display this information in a report. I'm currently using WMIC but with it being discontinued this year I'm trying to find an equivalent in either Powershell or CMD  and I have the need to display if the account is enabled or not.

I'm currently using ShellCommandTextReturn(cmd.exe /c wmic useraccount where "localaccount=true" get name)

I'm trying to create this script with powershell since it displays all the information I need but it's not showing any information in KACE.  It works fine in Powershell.  ShellCommandTextReturn(powershell.exe get-LocalUser)


0 Comments   [ + ] Show comments

Answers (3)

Answer Summary:
Posted by: jrodlivewire06 7 months ago
Senior White Belt
0

This broke after the latest appliance update. anyone have any ideas? I'm on version 13.2.182

Posted by: Mauricio Beltran 8 months ago
Senior White Belt
0

Top Answer

Hello jrodlivewire06,

Can you please try:

ShellCommandTextReturn(cmd /q /c cmd /q /c %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe (get-LocalUser))

I have tried that one in my lab and it works. I used this KB from Quest support as a reference:

https://support.quest.com/kace-systems-management-appliance/kb/4299395/cir-and-report-to-verify-patching-enhancement-bundle


Best regards,

Mauricio.

Posted by: jrodlivewire06 8 months ago
Senior White Belt
0

That worked perfectly. Thank you!

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ