May 3, 2015 at 5:23 pm
Comments posted to this topic are about the item Server Logins
May 4, 2015 at 12:12 am
Very good question. Thanks
May 4, 2015 at 6:19 am
Interesting question.
But I am disappointed the QotD was not May the 4th related.
May 4, 2015 at 6:44 am
I'm still looking for mention of "get or set the authentication message" in the reference link. I can't find it there, though the property "specifies the type of authentication" (not message!)
Am I being too literal?
Gerald Britton, Pluralsight courses
May 4, 2015 at 7:23 am
g.britton (5/4/2015)
I'm still looking for mention of "get or set the authentication message" in the reference link. I can't find it there, though the property "specifies the type of authentication" (not message!)Am I being too literal?
I didn't find it either. A DBA being literal? Who ever heard of such a thing? 😉
May 4, 2015 at 9:25 am
Xavon (5/4/2015)
Interesting question.But I am disappointed the QotD was not May the 4th related.
sorry, too busy and didn't think of it. Anyone want to send me one for next year 😉
May 4, 2015 at 10:02 am
Ed Wagner (5/4/2015)
g.britton (5/4/2015)
I'm still looking for mention of "get or set the authentication message" in the reference link. I can't find it there, though the property "specifies the type of authentication" (not message!)Am I being too literal?
I didn't find it either. A DBA being literal? Who ever heard of such a thing? 😉
I don't think LoginType gets or sets any sort of authentication message. It gets or sets the account type for the login.
However, that didn't make the question difficult, since the nonexistent "authentication type" couldn't be the answer, State is readonly so the interface can't set it, and HasAccess although it can be set as well as got merely determines whether the login has access to the instance, which leaves only Login.Type as a vaguely viable candidate (only because the authentication message is probably dependent on what sort of account th login is for which surely has some kind of influence on the authentication message :-D.
Tom
May 4, 2015 at 10:44 am
The "correct answer" is incorrect. That sets and gets the login METHOD not the MESSAGE. HASACCESS communicates the MESSAGE. +1
May 4, 2015 at 11:56 am
I don't understand why anyone would need to do this through PowerShell. Can someone who actually had such a need please explain? I'm looking for someone that actually did it this way for a good reason.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 5, 2015 at 5:58 am
Jeff Moden (5/4/2015)
I don't understand why anyone would need to do this through PowerShell. Can someone who actually had such a need please explain? I'm looking for someone that actually did it this way for a good reason.
I use PowerShell+SMO to sync Logins between servers, e.g. servers hosting related AlwaysOn replicas and servers related through Log Shipping. It allows me to run the PowerShell script from a central utility server (one that does not necessarily have to have an installed instance of SQL Server) and touch all related servers in the environment. When new servers are added to the environment I add only have to edit the configuration data the PowerShell script refers to in order to get Login syncing working across the new servers.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
May 5, 2015 at 6:24 am
Jeff Moden (5/4/2015)
I don't understand why anyone would need to do this through PowerShell. Can someone who actually had such a need please explain? I'm looking for someone that actually did it this way for a good reason.
PowerShell, definitely not me 😉
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
May 5, 2015 at 6:54 am
Orlando Colamatteo (5/5/2015)
Jeff Moden (5/4/2015)
I don't understand why anyone would need to do this through PowerShell. Can someone who actually had such a need please explain? I'm looking for someone that actually did it this way for a good reason.I use PowerShell+SMO to sync Logins between servers, e.g. servers hosting related AlwaysOn replicas and servers related through Log Shipping. It allows me to run the PowerShell script from a central utility server (one that does not necessarily have to have an installed instance of SQL Server) and touch all related servers in the environment. When new servers are added to the environment I add only have to edit the configuration data the PowerShell script refers to in order to get Login syncing working across the new servers.
That's cool. Thanks Orlando.
I thought that CMS was supposed to take care of stuff like that now.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 5, 2015 at 6:56 am
Thanks for the question. Maybe there should be an AuthenticationType.
May 5, 2015 at 7:29 am
Jeff Moden (5/5/2015)
Orlando Colamatteo (5/5/2015)
Jeff Moden (5/4/2015)
I don't understand why anyone would need to do this through PowerShell. Can someone who actually had such a need please explain? I'm looking for someone that actually did it this way for a good reason.I use PowerShell+SMO to sync Logins between servers, e.g. servers hosting related AlwaysOn replicas and servers related through Log Shipping. It allows me to run the PowerShell script from a central utility server (one that does not necessarily have to have an installed instance of SQL Server) and touch all related servers in the environment. When new servers are added to the environment I add only have to edit the configuration data the PowerShell script refers to in order to get Login syncing working across the new servers.
That's cool. Thanks Orlando.
I thought that CMS was supposed to take care of stuff like that now.
I use CMS for lots of stuff but am not using it for this, although I suppose I could leverage it. CMS offers a piece of what I need to know in the PowerShell script, namely the server list, however the list itself does not tell me which servers should be synced to which other servers. I could devise and adhere to some organization scheme in CMS that would help me know the source and target but that could go horribly wrong if someone made a mistake when editing CMS entries.
Another option would be for me to add some clever code to the PowerShell script that figured out from the System Views & System Tables on the source instance which target instances should have their Logins synced but I haven't taken my PowerShell script to that level.
You have given me some food for thought just by raising the idea of using a CMS, so thanks. For now at least, the maintenance overhead of adding an entry to the configuration my PowerShell is driven by when new servers are added in my environment is low enough.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
May 5, 2015 at 8:50 am
Jeff Moden (5/4/2015)
I don't understand why anyone would need to do this through PowerShell. Can someone who actually had such a need please explain? I'm looking for someone that actually did it this way for a good reason.
You don't need to, but certainly if you did any string manipulation or wanted to make this easy for others, including some validation or other programming, PoSh might be easier than SQLCMD with a parameter.
PoSh isn't necessarily better at tasks. However it does make it easier at scale, and it can be quicker. Certainly quicker for repetitive stuff run outside of SQL Server, across systems.
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply