sccmclictr icon indicating copy to clipboard operation
sccmclictr copied to clipboard

Suggestion: update get-wmiobject to get-ciminstance

Open samcharles93 opened this issue 7 years ago • 5 comments

I have noticed in a few of the commands run from clictr they run as get-wmiobject.

for example, Installed Programs runs sms_installedprograms as gwmi and returns "InstallDate" as an unreadable format, however if you just change to Get-CimInstance, the format is readable.

Get-CimInstance -ClassName SMS_InstalledSoftware -Namespace "ROOT\CIMV2\SMS

hope this makes some sort of sense.

samcharles93 avatar Mar 22 '18 04:03 samcharles93

Thx, will check that... Note that these Kind of changes will become part of the project: https://github.com/rzander/sccmclictrlib

rzander avatar Mar 22 '18 20:03 rzander

I've published an new sccmclictr.automation.dll (https://github.com/rzander/sccmclictrlib/releases) whic is using Get-CimInstance ... For testing, you can replace the existing version with the new one ...

rzander avatar Apr 18 '18 08:04 rzander

Can I suggest:

  • check if PS 3.0 (minimum required for CIM) is installed on local client executing tool

  • check if remote client will accept WinRM calls, and fallback to DCOM variant if not? (e.g. base Win7 installs with SP1)

This hardens the library and makes it more versatile. Otherwise remote clients report "blank" in s/w inventory for example. Happy to try to help with code / testing if required.

mhomoky avatar Jul 31 '18 13:07 mhomoky

PowerShell 4 is a requirement for the Host and the remote Client(https://github.com/rzander/sccmclictr#requirements) … Just update your Clients to >=PoSh 4 !

WinRM is also a requirement. It much easier to just enable WinRM on the OLD Win7 clients than rewriting the tool for an OS which is EOL soon...

rzander avatar Jul 31 '18 13:07 rzander

Get-CIM cmdlets were introduced in PoSH 3.0 IIRC. I can’t see any sane reason anyone upgrading PowerShell on a Win 7 client would install anything other than 5.1.

For the host I agree 5.1 is best (or >= 4.0), for WinRM support 2.0 works fine on the client as long as WinRM is running. This often requires psexec first to kick that off.

Our environment of around 3000+ PCs is all Win 7 and the customer refuses to install PoSH 5.1 in the imaging build, so all 5.1 installs are manual 😖

And on the support side there’s still > 18 months to run before EOL for Win 7, I think?

mhomoky avatar Aug 21 '18 14:08 mhomoky