davehull / Kansa

A Powershell incident response framework
Apache License 2.0
1.54k stars 266 forks source link

Some networking modules are not compatible with Windows 7 #136

Open jvaldezjr1 opened 8 years ago

jvaldezjr1 commented 8 years ago

I noticed in a run I did on a Win 7 host, some PowerShell cmdlets are only available to Windows 8.1 / Server 2012 family of operating systems. Below is a copy of the error message.

Get-NetRoutes reports error on localhost: "The term 'Get-NetRoute' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."

Get-NetIPInterfaces reports error on localhost: "The term 'Get-NetIPInterface' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."

This article here mentions the use of Net TCP/IP cmdlets: https://technet.microsoft.com/en-us/library/hh826123%28v=wps.630%29.aspx#feedback

My suspicion is that this may affect Windows 2008 Server OSes also if you try to run those modules. I'm sure there are other ways of getting this information, but wanted to highlight the issue. YMMV.

davehull commented 8 years ago

I believe these cmdlets are PSv3 and later, I don't think it's an OS version issue. Ymmv. In general, we've tried to avoid requiring anything later than PSv2, but obviously there are some exceptions.

jvaldezjr1 commented 8 years ago

I've got PSv4 on my Win7 box but the cmdlets there don't run. The modules do not show up with Get-Command either.

davehull commented 8 years ago

PS version specific cmdlets, OS specific cmdlets, third-party cmdlets... I can't keep them all straight. Linux's RPM has a --whatprovides so you can find out where a file comes from. It would be nice if PowerShell had something similar.

jvaldezjr1 commented 8 years ago

Add to that, I think PSv5 will only run on Windows 8.1/2012 family OSs too.

slw07g commented 6 years ago

Make sure you are including the ".ps1" extension at the end of the cmdlet name.

PolarBearGod commented 6 years ago

Some Windows 8+ modules are CDXML based. They can’t be made available on Windows 7 because the underlying WMI classes aren’t available; NetTCPIP is one of those modules.

Here is a list of modules that might not work on Windows 7 due to the classes not being available. BranchCache DirectAccessClientComponents DnsClient iSCSI MsDtc NetAdapter NetConnection NetLbfo NetQos NetSecurity NetSwitchTeam NetTCPIP NetworkConnectivityStatus NetworkTransition PrintManagement ScheduledTasks SmbShare SmbWitness Storage VpnClient Wdac