troubleshooting Question

How to get login script stored in mssql database

Avatar of mholmen
mholmenFlag for Sweden asked on
Microsoft Server OSMicrosoft Server Apps
1 Comment1 Solution508 ViewsLast Modified:
Hi,

I want to put an entire login script in a sql database and then get it when the user login in the domain.

I tested write a script like this:

Set obj_Shell = CreateObject("WScript.Shell")
select.txt run sp for print out login script in text form
Set obj_WSH = obj_Shell.Exec("sqlcmd -h-1 -S 192.168.0.184\wdb11 -U xx -P xx -d loginscript -i select.txt")

Set obj_STDOUT = obj_WSH.StdOut
str_Output = obj_STDOUT.ReadAll
WScript.echo str_Output

'objFile.writeLine str_Output


Can I use sql database for storing login script in text form in the database? And get it from there, and run it when the user login?

Regards
//Peter
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros