October 25, 2016 at 12:07 am
Comments posted to this topic are about the item Managing Registered servers with SQL Powershell
October 25, 2016 at 6:48 am
Cool, thanks, I'll give it a try.
October 25, 2016 at 9:25 am
This is a real timesaver, thanks for sharing 🙂
October 25, 2016 at 9:30 am
Not quite sure why you didn't do the whole thing in PS. Couldn't you have just used a PS array (you could . source it)? Or even a csv file if you want to store the data away from the code?
October 25, 2016 at 10:03 am
I could have done it like that, but this code is part of the monitoring & registration toolkit my collegues and I have written. I found it more convenient to be able to do this all in management studio
October 25, 2016 at 10:44 am
arco.scheepen (10/25/2016)
I could have done it like that, but this code is part of the monitoring & registration toolkit my collegues and I have written. I found it more convenient to be able to do this all in management studio
Playing the devil's advocate, you could do it all in PowerShell and do it all from SSMS (Powershell prompt)
October 25, 2016 at 10:56 am
http://www.sqlservercentral.com/articles/Registered+Servers/147023/
Managing Registered servers with SQL Powershell
By Arco Scheepen, 2016/10/25
what do you mean????? "The code below clears the Local Servers Group completely (be aware of this),"???
can I run it without this clearing of the LSG????
'dir -Recurse | Remove-Item -force; #clean up everything' + CHAR(13) + CHAR(10)
Local Servers Group??? that's on AD as a GPO, or Group or Container right???
Thanks
October 25, 2016 at 12:21 pm
I built the code with a bit of a brute force design. The dir -recurse | remove command clears the local servers list completely, and I rebuild the list again.
October 25, 2016 at 1:12 pm
trangen1 (10/25/2016)
http://www.sqlservercentral.com/articles/Registered+Servers/147023/Managing Registered servers with SQL Powershell
By Arco Scheepen, 2016/10/25
what do you mean????? "The code below clears the Local Servers Group completely (be aware of this),"???
can I run it without this clearing of the LSG????
'dir -Recurse | Remove-Item -force; #clean up everything' + CHAR(13) + CHAR(10)
Local Servers Group??? that's on AD as a GPO, or Group or Container right???
Thanks
It's the Local Servers Group stored locally in your SSMS instance. Don't think it has anything to do with AD.
Although it will remove anything the customer/user has added themselves.
Running it without clearing first will probably blow up.
October 25, 2016 at 2:11 pm
Thanks SSCrazy!!!
October 25, 2016 at 2:13 pm
yes, I'm a NEWB, I've been following SQLServerCentral for a while, just never encountered a situation where I needed to ask a question until now.
I hope you guys post more"SQL Powershell tips" I love it!!!!!
October 25, 2016 at 2:30 pm
Hi Grasshopper,
yes, but I'm in Database "Security" so my purpose to run the code is to audit it, I don't want to damage or delete anything, because I'm not going to-and-don't-want-to REBUILD anything.
I just want a list of the servers, is my intent.
So how do I do that without "clearing" the 'local server group'????
Thanks
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply