For those that attended my webinar last week with Pragmatic Works I have uploaded the code…finally. For what it is worth, the weekend was busy and I was working on my SQL PASS Summit submissions. Then, just as I was getting this together on Monday night, I was not feeling right and realized I was making mistakes and that is no good. Tried to go to work on Tuesday but even they knew something was wrong with me. Went home and found out later my nephew was also sick. No need for any further details. Just trying to get better. Thanks for your patience. 🙂
The lovely people at Pragmatic Works sent me some of your questions from the webinar. Without further adieu…
Do you have a suggestion for BEGINNERS learning books to get a basic understanding of PS??
Great question! While I have a TON of books on all kinds of things (SQL Server, C#, web dev stuff, etc.) I do not have a single book on Powershell. How did I accomplish all this then? Simple – using this pesky thing we call the internet. I have also attended some great Powershell sessions at SQL Saturday events.
Did they leave any beer bottles?
The roofers? Thankfully no.
Do not criticize the king of soda pop, Dr. Pepper!
When will VBScript stop functioning for SQL Server or Windows Server. As in will there be a total switch?
VBScript? Hmmmm…great question. No clue. This might be a Microsoft cockroach. Like replication.
why we need a PS-Drive – why we can just use an arraay directly?
You mean passing in the server name from the array to the Invoke-SqlCmd? Yeah, you could do that. That’s just not how I wrote this. 🙂
what is her email again?
Leave a comment here if you would like to email me and I will get back to you.
does the ( $servers | Measure-Object).count syntax do?
That counts the number of items in the array.
What is the purpose of the New-PSDrive?
New-PSDrive is a method of connecting to a SQL Server instance. Another method would be to declare a connection with SMO (Server Management Objects).
Does it work on windows 2003 as well?
I have not tested this against Windows Server 2003.
so, ps-drive is the equivalent of object explorer in SSMS?
Well, kinda. Maybe. More the equivalent of browsing a drive in a cmd.exe window.
what city in Austin?
Ummmm….Austin is a city.
What permission you require on AD for this excercise
To make the AD changes, I have no clue. Not my area and I also intentionally created the Azure VM so I could make all the changes I needed to without worrying about a silly thing like permissions. As far as reading from AD (which is the main Powershell script for this part) I am not sure about this either but I am assuming you need some level of read permissions (which is all that script is doing).
There are some things where I may tend to run something, and if anyone says anything, ask forgiveness later. Security is pretty tight where I am – I have gotten dinged on xp_cmdshell but so far nothing on reading from AD. If for some reason you can’t run anything against AD, I would find the person over that and find out why, and let them know what you are trying to do.
Thanks again to everyone who attended. If you have any other questions leave a comment. 🙂