PowerShell WQL WMI 📚 WQL via PowerShell

WMI Query Language (WQL) – Data Queries: Associators Of

• 5 min read

As we saw in the previous post, Select queries can be used to retrieve instances of WMI class. But select queries are not the only way to query for instances. We can also use Associators Of keyword to the same. However, there is a difference. Select queries always return a collection of instances of a WMI class where as “Associators Of” returns a collection of WMI objects that belong to different WMI classes or associated WMI classes. Before we dig too much in to this, let us first understand what are associated WMI classes.

Read more
PowerShell WQL WMI 📚 WQL via PowerShell

WMI Query Language (WQL) – Data Queries: SELECT, FROM, and WHERE

• 4 min read

In this part of the series on WQL, we will look at what are data queries and how some of the WQL keywords & operators can be used to retrieve information from WMI repository. Also, as mentioned earlier, there are many other tools that consume WQL queries to retrieve information from WMI. However, in this series, I shall use only PowerShell to demonstrate WQL.

WQL data queries are the most simplest form of querying for WMI data. Data queries are used to retrieve class instances and data associations. For example,

Read more
PowerShell WQL WMI 📚 WQL via PowerShell

WMI Query Language (WQL) – Keywords and Operators

• 3 min read

In this post, we will look at the a brief description of WQL keywords and operators and see a classification of the keywords based on where (query types) these keywords can be used.

Keywords

Similar to SQL, WQL queries use keywords to retrieve data from the management objects. WQL has 19 keywords to perform these queries against WMI repositories. In the previous post, we discussed about three types of queries: Data, Event, and Schema. Though there are 19 WQL keywords, only a few of them can be used all 3 possible query types. The following table lists all the WQL keywords and lists the query type in which they can be used.

Read more
PowerShell WQL WMI 📚 WQL via PowerShell

WMI Query Language (WQL) – An introduction

• 4 min read

I have been using WMI a lot these days and got to play with WQL as well. In this series of posts, I want to write about how WMI Query Language (WQL) can be used to retrieve management data exposed by WMI. Yes, this has nothing to do with PowerShell but as a PowerShell lover (and a MVP now), I will use PowerShell for all my examples.

Windows Management Instrumentation (WMI) is the Microsoft implementation of Web-based Enterprise Management (WBEM), which is an industry initiative to develop a standard technology for accessing management information in an enterprise environment. WMI uses the Common Information Model (CIM) industry standard to represent systems, applications, networks, devices, and other managed components. CIM is developed and maintained by the Distributed Management Task Force (DMTF). We can write WMI scripts to automate several tasks on local or remote computer(s).

Read more
PowerShell Bangalore IT Pro Presentations

Slides: Getting Started with PowerShell scripting

• 1 min read

I just came back from the PowerShell / Bangalore ITPro UG meet. We had nearly 40 people showing up for this event. I spoke about getting started with PowerShell scripting and Ismail talked about Exchange 2010 migration. Here are the slides I used for my session.

If you were there at the session, please provide your feedback either here or as a tweet to @psbug. See you at the next meet.

Read more
PowerShell Remoting 📚 PowerShell Remoting

PowerShell 2.0 remoting guide: Part 12 – Using CredSSP for multi-hop authentication

• 4 min read

In this part of the remoting series, we look at how CredSSP can be used for multi-hop authentication in PowerShell remoting. CredSSP and multi-hop support are not features of PowerShell 2.0 or PowerShell remoting, per se. Credential Security Service Provider (CredSSP) is a new security service provider that enables an application to delegate the user’s credentials from the client to the target server. Multi-hop support in Windows Remote Management uses CredSSP for authentication. Since PowerShell 2.0 remoting is built on top of WinRM, we can use CredSSP to perform multi-hop authentication.

Read more
PowerShell Remoting 📚 PowerShell Remoting

PowerShell 2.0 remoting guide: Part 11 – Interpreting, formatting and displaying remote output

• 5 min read

In this part of the remoting series, we look at remoting output. This includes how the output is transferred from remote computer to local, how it is displayed and how we can format this output based on a need. We already discussed various methods to execute commands (part4, part 5 and part 6) on a remote computer. In this post, for the sake of our discussion of remoting output, I will use only Invoke-Command method to execute remote commands. However, I will point out the differences as required.

Read more
PowerShell Remoting 📚 PowerShell Remoting

PowerShell 2.0 remoting guide: Part 10 – Restricting available commands using custom session configuration

• 3 min read

“With great power comes great responsibility”, said uncle Ben. But some people don’t just understand that. That is when you have to rip-off their powers. Similarly, the default PS Session configuration allows full access to PowerShell language, cmdlets, scripts and everything available to PowerShell. Of course, you need to authenticate as a local administrator or should have execute permission to invoke the session. Running a few cmdlets such as Stop-Service or Restart-Computer can be quite dangerous on a production server. This is where a custom session configuration can help provide role based access to remote host using PowerShell remoting.

Read more