?
Solved

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

Posted on 2003-11-08
1
Medium Priority
?
657 Views
Last Modified: 2013-12-04
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
0
Comment
Question by:KABOOM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
TooKoolKris earned 1000 total points
ID: 9716192
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The term "Bad USB" is a buzz word that is usually used when talking about attacks on computer systems that involve USB devices. In this article, I will show what possibilities modern windows systems (win8.x and win10) offer to fight these attacks wi…
Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question