PDQ PowerShell scanner is here, and we think it is incredible! Once you are done jumping for joy, you may be wondering how to get started. Well, we have a few scripts available for you right out of the gate. There are a lot of great options in there to not only get you started but also help you see how to write your own and get the best results. Watch the accompanying video to this blog post here.
How to get Mapped Drives
With that in mind, let’s break down the Mapped Drives script that Colby wrote here. Is there such a thing as too much data? We don’t think so; We created this to help you have some more in-depth insights into your current environment.
Breaking down the script
The most important part of this script is grabbing the drives, this is a really quick one-liner. (See more about HKEY_USERS)
We are grabbing all this information for the currently logged-on user. It is possible to grab this for all users, but you get into some dicey territory where a lot can go wrong. It involves grabbing registry of all users, but if you plan to do that please pay special attention to his warning in those blogs.
This will work, but you are getting less info, and the titles are not really clear either. So we took that output and put it into a pscustomobject where we can customize what we are getting. First, we need to break down the parent path for the SID. We will use this to put out both the SID as well as the user name.
Now that we have that we just need to put all that we have captured into the pscustomobject.
That should be all you need, but let’s show what it looks like when it is all put together. This will make it clear, as well as highlight that Colby explains it all way better with just a few comments!
Put it all together
Jordan had spent his life wondering why tasks he didn’t like to do had no options to complete themselves. Eventually he had to make that happen on his own. It turned out that he enjoyed making tasks complete themselves, and PDQ thought that is something he should talk about on the internet while drinking most Thursdays on the PDQ webcast.