SlideShare a Scribd company logo
Required Slide
Inventory Your Network and Clientswith Windows PowerShellDon JonesSenior Partner and TechnologistConcentrated Technology, LLCRequired SlideSESSION CODE: WCL308
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgregThis work is copyright ©Concentrated Technology, LLC
IntroductionsMe: Don Jones, Concentrated TechnologyMicrosoft MVP Award recipientContributing Editor, TechNet MagazineAuthor of 45+ IT booksBlogger at http://ConcentratedTech.comYou: A Busy Windows AdministratorNeeding to inventory management information from one or more remote computers, both server and client (but especially client)
AgendaWindows PowerShell, BrieflyWindows Management Instrumentation, BrieflyExploring WMIPlaying with WMI on Your Local ComputerUsing WMI on Remote ComputersMaking a Flexible WMI Tool in Steps
Windows PowerShell, BrieflyThis session’s code will work with v1 and v2 (up until “advanced functions” at the very end – that’s v2 only)V1: Ships with Win2008 and Vista, available for WinXP and Win2003V2: Ships with Win2008R2 and Win7, available for WinXP, Win2003, Vista, and Win2008Primarily a command-line shell; has scripting capabilities, but we won’t be diving into them (much) – we’ll be using scripts as “batch files” mainlyNote: I make all scripts downloadable from my Web site, no need to take notes
Security NotesWindows PowerShell disables script execution (but not commands) by default; see Help about_execution* for detailsWindows PowerShell is subject to User Account Control (UAC); for our purposes, ensure you explicitly run “as Administrator” for necessary remote privileges
WMI, BrieflyPresent since Windows NT 4.0Does not require PowerShell on the remote computerUses Remote Procedure Calls (RPCs) for communication; does not require PowerShell v2 / WinRM “remoting” on remote machinesOrganized into:Namespaces: Top-level, strictly organizational, usually product-relatedClasses: Represent potential manageable elementsInstances: Real-world occurrences of classesProperties & Methods: Elements of an instanceProperties contain management informationMethods perform actions (such as reconfiguration)
WMI SecurityConfigured (by default) on the root namespaceTypically, don’t mess with this – many things rely on WMI and can get angry if you fuss with the permissionsUse WMI Control MMC snap-in to modify (or view – great way for seeing what namespaces are installed)
WMI Security and NamespacesDEMO
Differences from Machine to MachineWMI namespaces will vary based on the roles/products/technologies installed on a computerIndividual classes will vary based on product or Windows versionClasses’ properties and methods can vary from version to version, tooCore Windows OS and hardware stuff is in \root\CIMv2; most classes start with Win32_ or CIM_ prefix in the class nameBest to get a “WMI Explorer” or “WMI Browser” that can be focused at a remote computer to see what that computer hasYou don’t need a class on your computer in order to query it from a remote computer (very handy)
DocumentationEasiest: Plug class name into favorite search engineFirst 1-2 results usually msdn.microsoft.com/…, which will be what you wantOnly rely on “core” classes being well-documented – everything else is pretty inconsistently documentedUse search engines to find examples – even VBScript examples can usually provide some helpPipe retrieved WMI objects to Get-Member or to Format-List * in order to see what properties/methods they have, and what values the properties contain
Exploring WMIDEMO
Using PowerShell LocallyUse Get-WmiObjectcmdletCannot specify alternate credentials for local connections (by design); make sure shell is running as AdministratorSpecify –class name to query; retrieves all instances and all properties by default
Filtering ResultsUse –filter parameter to narrow down instances returned (large result sets can take a lot of time and resources)-filter "property <comparison> value”Numeric values are not delimitedString/date values are delimited in single quotesEasiest to enclose the entire filter in double quotesValid comparison operators:=   >   <   <>   <=   => LIKE (use % as a wildcard)These are different from PowerShell’s native operators!
WMI in PowerShell, LocallyDEMO
Going RemoteUse –computerName parameter to specify remote computer(s)-computername ”Client17”-computername (get-content names.txt)-computername “client17”,”client18”,”client19”Other parameters allow specification of alternate credential-credential CONTOSO\AdministratorGraphically prompts for password – by designUse Get-Credentialto create a reusable credential object that contains a password
Multiple ComputersRemote connections are synchronous and sequential (not parallel)Use –AsJob to run in backgroundUse remoting (Invoke-Command) for parallel processing (not in this session)Failure of one computer will not stop the command from continuingYou can trap errors and log them; we’ll see how later
WMI in PowerShell, RemotelyDEMO
The StepsMove command into a “batch file” for easier repetitionEnclose command in a function for parameterizationAdd error handling / loggingUpgrade function to a filtering function to accept pipeline inputEnables scenarios like getting names from AD OR a text fileUpgrade function to an advanced function (v2 only) for cmdlet-like behaviorPackage as a Script Module (v2 only) for easier distribution and re-use by othersAdd comment-based help so you can tell what the heck it’s doing(I’ll demo – you remind me of what step is next)
Building a WMI ToolDEMORemember! I’ll save all my scripts and make them downloadable fromwww.ConcentratedTech.com in a few days – no need to take notes!
ConclusionWMI + PowerShell = Very Powerful, Very ConvenientAnd a great way to learn PowerShell incrementally!Build reusable, cmdlet-like toolsNow in the TechEd Bookstore:Windows PowerShell v2: TFM by Don Jones & Jeffery HicksDownload this session’s scripts & slides fromwww.ConcentratedTech.com
Track ResourcesRequired Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Resource  1Resource  2Resource  3Resource  4
ResourcesRequired SlideLearningSessions On-Demand & CommunityMicrosoft Certification & Training Resourceswww.microsoft.com/techedwww.microsoft.com/learningResources for IT ProfessionalsResources for Developershttp://microsoft.com/technethttp://microsoft.com/msdn
Related ContentRequired SlideSpeakers, please list the Breakout Sessions, Interactive Sessions, Labs and Demo Stations that are related to your session.Breakout Sessions (session codes and titles)Interactive Sessions (session codes and titles)Hands-on Labs (session codes and titles)Product Demo Stations (demo station title and location)
Required SlideComplete an evaluation on CommNet and enter to win!
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation.  Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.  MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgregThis work is copyright ©Concentrated Technology, LLC
Ad

More Related Content

Viewers also liked (19)

Ad disasters & how to prevent them
Ad disasters & how to prevent themAd disasters & how to prevent them
Ad disasters & how to prevent them
Concentrated Technology
 
Automating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShellAutomating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShell
Concentrated Technology
 
PowerShell v4 Desired State Configuration
PowerShell v4 Desired State ConfigurationPowerShell v4 Desired State Configuration
PowerShell v4 Desired State Configuration
Jason Stangroome
 
Basic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 sessionBasic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 session
Rob Dunn
 
PowerShell Functions
PowerShell FunctionsPowerShell Functions
PowerShell Functions
mikepfeiffer
 
Managing SQLserver
Managing SQLserverManaging SQLserver
Managing SQLserver
Concentrated Technology
 
No-script PowerShell v2
No-script PowerShell v2No-script PowerShell v2
No-script PowerShell v2
Concentrated Technology
 
PS scripting and modularization
PS scripting and modularizationPS scripting and modularization
PS scripting and modularization
Concentrated Technology
 
Ha & drs gotcha's
Ha & drs gotcha'sHa & drs gotcha's
Ha & drs gotcha's
Concentrated Technology
 
PowerShell custom properties
PowerShell custom propertiesPowerShell custom properties
PowerShell custom properties
Concentrated Technology
 
PowerShell and WMI
PowerShell and WMIPowerShell and WMI
PowerShell and WMI
Concentrated Technology
 
Automating ad with powershell
Automating ad with powershellAutomating ad with powershell
Automating ad with powershell
Concentrated Technology
 
Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!
Thomas Lee
 
PS error handling and debugging
PS error handling and debuggingPS error handling and debugging
PS error handling and debugging
Concentrated Technology
 
Server Core2
Server Core2Server Core2
Server Core2
Concentrated Technology
 
VDI-in-a-Box: Microsoft Desktop Virtualization for Smaller Businesses and Uses
VDI-in-a-Box:  Microsoft Desktop Virtualization for Smaller Businesses and UsesVDI-in-a-Box:  Microsoft Desktop Virtualization for Smaller Businesses and Uses
VDI-in-a-Box: Microsoft Desktop Virtualization for Smaller Businesses and Uses
Concentrated Technology
 
Introduction to powershell
Introduction to powershellIntroduction to powershell
Introduction to powershell
Salaudeen Rajack
 
Free tools for win server administration
Free tools for win server administrationFree tools for win server administration
Free tools for win server administration
Concentrated Technology
 
Ive got a powershell secret
Ive got a powershell secretIve got a powershell secret
Ive got a powershell secret
Chris Conte
 
Automating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShellAutomating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShell
Concentrated Technology
 
PowerShell v4 Desired State Configuration
PowerShell v4 Desired State ConfigurationPowerShell v4 Desired State Configuration
PowerShell v4 Desired State Configuration
Jason Stangroome
 
Basic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 sessionBasic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 session
Rob Dunn
 
PowerShell Functions
PowerShell FunctionsPowerShell Functions
PowerShell Functions
mikepfeiffer
 
Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!
Thomas Lee
 
VDI-in-a-Box: Microsoft Desktop Virtualization for Smaller Businesses and Uses
VDI-in-a-Box:  Microsoft Desktop Virtualization for Smaller Businesses and UsesVDI-in-a-Box:  Microsoft Desktop Virtualization for Smaller Businesses and Uses
VDI-in-a-Box: Microsoft Desktop Virtualization for Smaller Businesses and Uses
Concentrated Technology
 
Introduction to powershell
Introduction to powershellIntroduction to powershell
Introduction to powershell
Salaudeen Rajack
 
Free tools for win server administration
Free tools for win server administrationFree tools for win server administration
Free tools for win server administration
Concentrated Technology
 
Ive got a powershell secret
Ive got a powershell secretIve got a powershell secret
Ive got a powershell secret
Chris Conte
 

Similar to Inventory your network and clients with PowerShell (20)

Windows Server 2008 Management
Windows Server 2008 ManagementWindows Server 2008 Management
Windows Server 2008 Management
Hi-Techpoint
 
PowerShell Remoting
PowerShell RemotingPowerShell Remoting
PowerShell Remoting
Concentrated Technology
 
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Microsoft TechNet
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
Joel Oleson
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
Orbit One - We create coherence
 
Administration & Gestion de Windows Server 2019
Administration & Gestion de Windows Server 2019Administration & Gestion de Windows Server 2019
Administration & Gestion de Windows Server 2019
amouwawa
 
Windows PowerShell Remoting Presentation.pdf
Windows PowerShell Remoting Presentation.pdfWindows PowerShell Remoting Presentation.pdf
Windows PowerShell Remoting Presentation.pdf
Syahri Ramadhan
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
How to become a Super Productive Developer
How to become a Super Productive DeveloperHow to become a Super Productive Developer
How to become a Super Productive Developer
Abhishek Sur
 
Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008
Carter Shanklin
 
PowerShell in the enterprise - TechED India 2011
PowerShell in the enterprise - TechED India 2011PowerShell in the enterprise - TechED India 2011
PowerShell in the enterprise - TechED India 2011
Ravikanth Chaganti
 
Wsv406 Advanced Automation Using Windows Power Shell2.0
Wsv406 Advanced Automation Using Windows Power Shell2.0Wsv406 Advanced Automation Using Windows Power Shell2.0
Wsv406 Advanced Automation Using Windows Power Shell2.0
jsnover1
 
NET Event - Migrating WinForm
NET Event - Migrating WinFormNET Event - Migrating WinForm
NET Event - Migrating WinForm
Raffaele Garofalo
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Frank La Vigne
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
Bala Subra
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
Bala Subra
 
Meet Windows PowerShell
Meet Windows PowerShellMeet Windows PowerShell
Meet Windows PowerShell
Concentrated Technology
 
Sql Server & PowerShell
Sql Server & PowerShellSql Server & PowerShell
Sql Server & PowerShell
Aaron Shilo
 
Wsv315 Windows Power Shell For Beginners
Wsv315 Windows Power Shell For BeginnersWsv315 Windows Power Shell For Beginners
Wsv315 Windows Power Shell For Beginners
jsnover1
 
Windows Server 2008 Management
Windows Server 2008 ManagementWindows Server 2008 Management
Windows Server 2008 Management
Hi-Techpoint
 
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Microsoft TechNet
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
Joel Oleson
 
Administration & Gestion de Windows Server 2019
Administration & Gestion de Windows Server 2019Administration & Gestion de Windows Server 2019
Administration & Gestion de Windows Server 2019
amouwawa
 
Windows PowerShell Remoting Presentation.pdf
Windows PowerShell Remoting Presentation.pdfWindows PowerShell Remoting Presentation.pdf
Windows PowerShell Remoting Presentation.pdf
Syahri Ramadhan
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
How to become a Super Productive Developer
How to become a Super Productive DeveloperHow to become a Super Productive Developer
How to become a Super Productive Developer
Abhishek Sur
 
Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008
Carter Shanklin
 
PowerShell in the enterprise - TechED India 2011
PowerShell in the enterprise - TechED India 2011PowerShell in the enterprise - TechED India 2011
PowerShell in the enterprise - TechED India 2011
Ravikanth Chaganti
 
Wsv406 Advanced Automation Using Windows Power Shell2.0
Wsv406 Advanced Automation Using Windows Power Shell2.0Wsv406 Advanced Automation Using Windows Power Shell2.0
Wsv406 Advanced Automation Using Windows Power Shell2.0
jsnover1
 
NET Event - Migrating WinForm
NET Event - Migrating WinFormNET Event - Migrating WinForm
NET Event - Migrating WinForm
Raffaele Garofalo
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Frank La Vigne
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
Bala Subra
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
Bala Subra
 
Sql Server & PowerShell
Sql Server & PowerShellSql Server & PowerShell
Sql Server & PowerShell
Aaron Shilo
 
Wsv315 Windows Power Shell For Beginners
Wsv315 Windows Power Shell For BeginnersWsv315 Windows Power Shell For Beginners
Wsv315 Windows Power Shell For Beginners
jsnover1
 
Ad

More from Concentrated Technology (19)

Wsus sample scripts
Wsus sample scriptsWsus sample scripts
Wsus sample scripts
Concentrated Technology
 
Wsus best practices
Wsus best practicesWsus best practices
Wsus best practices
Concentrated Technology
 
Virtualization today
Virtualization todayVirtualization today
Virtualization today
Concentrated Technology
 
Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0
Concentrated Technology
 
Vdi in-a-box
Vdi in-a-boxVdi in-a-box
Vdi in-a-box
Concentrated Technology
 
Top ESXi command line v2.0
Top ESXi command line v2.0Top ESXi command line v2.0
Top ESXi command line v2.0
Concentrated Technology
 
Supporting SQLserver
Supporting SQLserverSupporting SQLserver
Supporting SQLserver
Concentrated Technology
 
Securely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rdsSecurely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rds
Concentrated Technology
 
Rapidly deploying software
Rapidly deploying softwareRapidly deploying software
Rapidly deploying software
Concentrated Technology
 
PowerShell crashcourse for Sharepoint admins
PowerShell crashcourse for Sharepoint adminsPowerShell crashcourse for Sharepoint admins
PowerShell crashcourse for Sharepoint admins
Concentrated Technology
 
Prepping software for w7 deployment
Prepping software for w7 deploymentPrepping software for w7 deployment
Prepping software for w7 deployment
Concentrated Technology
 
PowerShell crashcourse for sharepoint
PowerShell crashcourse for sharepointPowerShell crashcourse for sharepoint
PowerShell crashcourse for sharepoint
Concentrated Technology
 
PowerShell crashcourse
PowerShell crashcoursePowerShell crashcourse
PowerShell crashcourse
Concentrated Technology
 
PowerShell crash course
PowerShell crash coursePowerShell crash course
PowerShell crash course
Concentrated Technology
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
Concentrated Technology
 
Implementing dr w. hyper v clustering
Implementing dr w. hyper v clusteringImplementing dr w. hyper v clustering
Implementing dr w. hyper v clustering
Concentrated Technology
 
Iis implementation
Iis implementationIis implementation
Iis implementation
Concentrated Technology
 
Hyper v r2 deep dive
Hyper v r2 deep diveHyper v r2 deep dive
Hyper v r2 deep dive
Concentrated Technology
 
How to configure esx to pass an audit
How to configure esx to pass an auditHow to configure esx to pass an audit
How to configure esx to pass an audit
Concentrated Technology
 
Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0
Concentrated Technology
 
Securely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rdsSecurely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rds
Concentrated Technology
 
PowerShell crashcourse for Sharepoint admins
PowerShell crashcourse for Sharepoint adminsPowerShell crashcourse for Sharepoint admins
PowerShell crashcourse for Sharepoint admins
Concentrated Technology
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
Concentrated Technology
 
Ad

Recently uploaded (20)

Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 

Inventory your network and clients with PowerShell

  • 2. Inventory Your Network and Clientswith Windows PowerShellDon JonesSenior Partner and TechnologistConcentrated Technology, LLCRequired SlideSESSION CODE: WCL308
  • 3. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgregThis work is copyright ©Concentrated Technology, LLC
  • 4. IntroductionsMe: Don Jones, Concentrated TechnologyMicrosoft MVP Award recipientContributing Editor, TechNet MagazineAuthor of 45+ IT booksBlogger at http://ConcentratedTech.comYou: A Busy Windows AdministratorNeeding to inventory management information from one or more remote computers, both server and client (but especially client)
  • 5. AgendaWindows PowerShell, BrieflyWindows Management Instrumentation, BrieflyExploring WMIPlaying with WMI on Your Local ComputerUsing WMI on Remote ComputersMaking a Flexible WMI Tool in Steps
  • 6. Windows PowerShell, BrieflyThis session’s code will work with v1 and v2 (up until “advanced functions” at the very end – that’s v2 only)V1: Ships with Win2008 and Vista, available for WinXP and Win2003V2: Ships with Win2008R2 and Win7, available for WinXP, Win2003, Vista, and Win2008Primarily a command-line shell; has scripting capabilities, but we won’t be diving into them (much) – we’ll be using scripts as “batch files” mainlyNote: I make all scripts downloadable from my Web site, no need to take notes
  • 7. Security NotesWindows PowerShell disables script execution (but not commands) by default; see Help about_execution* for detailsWindows PowerShell is subject to User Account Control (UAC); for our purposes, ensure you explicitly run “as Administrator” for necessary remote privileges
  • 8. WMI, BrieflyPresent since Windows NT 4.0Does not require PowerShell on the remote computerUses Remote Procedure Calls (RPCs) for communication; does not require PowerShell v2 / WinRM “remoting” on remote machinesOrganized into:Namespaces: Top-level, strictly organizational, usually product-relatedClasses: Represent potential manageable elementsInstances: Real-world occurrences of classesProperties & Methods: Elements of an instanceProperties contain management informationMethods perform actions (such as reconfiguration)
  • 9. WMI SecurityConfigured (by default) on the root namespaceTypically, don’t mess with this – many things rely on WMI and can get angry if you fuss with the permissionsUse WMI Control MMC snap-in to modify (or view – great way for seeing what namespaces are installed)
  • 10. WMI Security and NamespacesDEMO
  • 11. Differences from Machine to MachineWMI namespaces will vary based on the roles/products/technologies installed on a computerIndividual classes will vary based on product or Windows versionClasses’ properties and methods can vary from version to version, tooCore Windows OS and hardware stuff is in \root\CIMv2; most classes start with Win32_ or CIM_ prefix in the class nameBest to get a “WMI Explorer” or “WMI Browser” that can be focused at a remote computer to see what that computer hasYou don’t need a class on your computer in order to query it from a remote computer (very handy)
  • 12. DocumentationEasiest: Plug class name into favorite search engineFirst 1-2 results usually msdn.microsoft.com/…, which will be what you wantOnly rely on “core” classes being well-documented – everything else is pretty inconsistently documentedUse search engines to find examples – even VBScript examples can usually provide some helpPipe retrieved WMI objects to Get-Member or to Format-List * in order to see what properties/methods they have, and what values the properties contain
  • 14. Using PowerShell LocallyUse Get-WmiObjectcmdletCannot specify alternate credentials for local connections (by design); make sure shell is running as AdministratorSpecify –class name to query; retrieves all instances and all properties by default
  • 15. Filtering ResultsUse –filter parameter to narrow down instances returned (large result sets can take a lot of time and resources)-filter "property <comparison> value”Numeric values are not delimitedString/date values are delimited in single quotesEasiest to enclose the entire filter in double quotesValid comparison operators:= > < <> <= => LIKE (use % as a wildcard)These are different from PowerShell’s native operators!
  • 16. WMI in PowerShell, LocallyDEMO
  • 17. Going RemoteUse –computerName parameter to specify remote computer(s)-computername ”Client17”-computername (get-content names.txt)-computername “client17”,”client18”,”client19”Other parameters allow specification of alternate credential-credential CONTOSO\AdministratorGraphically prompts for password – by designUse Get-Credentialto create a reusable credential object that contains a password
  • 18. Multiple ComputersRemote connections are synchronous and sequential (not parallel)Use –AsJob to run in backgroundUse remoting (Invoke-Command) for parallel processing (not in this session)Failure of one computer will not stop the command from continuingYou can trap errors and log them; we’ll see how later
  • 19. WMI in PowerShell, RemotelyDEMO
  • 20. The StepsMove command into a “batch file” for easier repetitionEnclose command in a function for parameterizationAdd error handling / loggingUpgrade function to a filtering function to accept pipeline inputEnables scenarios like getting names from AD OR a text fileUpgrade function to an advanced function (v2 only) for cmdlet-like behaviorPackage as a Script Module (v2 only) for easier distribution and re-use by othersAdd comment-based help so you can tell what the heck it’s doing(I’ll demo – you remind me of what step is next)
  • 21. Building a WMI ToolDEMORemember! I’ll save all my scripts and make them downloadable fromwww.ConcentratedTech.com in a few days – no need to take notes!
  • 22. ConclusionWMI + PowerShell = Very Powerful, Very ConvenientAnd a great way to learn PowerShell incrementally!Build reusable, cmdlet-like toolsNow in the TechEd Bookstore:Windows PowerShell v2: TFM by Don Jones & Jeffery HicksDownload this session’s scripts & slides fromwww.ConcentratedTech.com
  • 23. Track ResourcesRequired Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Resource 1Resource 2Resource 3Resource 4
  • 24. ResourcesRequired SlideLearningSessions On-Demand & CommunityMicrosoft Certification & Training Resourceswww.microsoft.com/techedwww.microsoft.com/learningResources for IT ProfessionalsResources for Developershttp://microsoft.com/technethttp://microsoft.com/msdn
  • 25. Related ContentRequired SlideSpeakers, please list the Breakout Sessions, Interactive Sessions, Labs and Demo Stations that are related to your session.Breakout Sessions (session codes and titles)Interactive Sessions (session codes and titles)Hands-on Labs (session codes and titles)Product Demo Stations (demo station title and location)
  • 26. Required SlideComplete an evaluation on CommNet and enter to win!
  • 27. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • 28. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgregThis work is copyright ©Concentrated Technology, LLC