Batch Script - Retrieve Settings for IIS, Win, SQL Server

I'm trying to write a generic batch script to gather a bunch of security settings from various Windows 2000 computers.  I'm almost done but i'm stuck on a couple of things:

1. How do I get the "user rights assignments" and "Security options" from the local security policy?

2. For IIS, is it possible to get a list of script mappings (ie: .printer, .asp, .idq, etc)

3. How do I get the list of users and their permissions in SQL Server 7 or 2000?

Being from the Linux world, i've been struggling to find a list of the more hidden Window commands but haven't had any success (I know about the ones listed when I type help - but not much more).  I'm not sure how much of the above is actually possible through a batch script but your help is much appreciated.

Thanks,
KABOOM
KABOOMAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TooKoolKrisCommented:
Your not going to accomplish these things by using a batch file. You need to use some scripting.

Here's one for obtaining user account information. Remember to replace the "." variable in "strComputer" to that of the computer name or IP of the computer you are retreiving the info from. You need to use .vbs as the format.

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_UserAccount",,48)
For Each objItem in colItems
    Wscript.Echo "AccountType: " & objItem.AccountType
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "Disabled: " & objItem.Disabled
    Wscript.Echo "Domain: " & objItem.Domain
    Wscript.Echo "FullName: " & objItem.FullName
    Wscript.Echo "InstallDate: " & objItem.InstallDate
    Wscript.Echo "LocalAccount: " & objItem.LocalAccount
    Wscript.Echo "Lockout: " & objItem.Lockout
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "PasswordChangeable: " & objItem.PasswordChangeable
    Wscript.Echo "PasswordExpires: " & objItem.PasswordExpires
    Wscript.Echo "PasswordRequired: " & objItem.PasswordRequired
    Wscript.Echo "SID: " & objItem.SID
    Wscript.Echo "SIDType: " & objItem.SIDType
    Wscript.Echo "Status: " & objItem.Status
Next

You are probably going to have to do some searching for the info you want from IIS and SQL as these would be different objects outside of the WSH library. I'm pretty sure each has it's own SDK that would have tools in there for automating tasks via scripting as well.

Good Luck
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
OS Security

From novice to tech pro — start learning today.