Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Mar 29, 2024 11:33 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 23 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Feb 08, 2008 6:49 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Hi,

Since we already are showing MDAC, Media Players etc. on the OS page, it might be helpful to also include the listing of the System DSNs/ODBC connections defined on systems.

This value is usually in the registry at:

HKLM\Software\ODBC\ODBC.INI\<DSN Name>

under the DSN name includes helpful info like:

1. Database Name
2. Database Server Name
3. Is the connection a trusted connection?
4. Last user who used the c=DSN
5. Which ODBC driver is being used

I can to the VB code for it, but the input to the database involving schema changes I am uncomfortable with.

Thanks

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 11, 2008 12:15 pm 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
if it is documented somewhere how to:

1. add a new table to the DB

I can attempt coding this along with WSUS settings/info for clients.

Thanks,

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 11, 2008 3:31 pm 
Offline
Newbie

Joined: Tue Dec 11, 2007 2:40 am
Posts: 24
Location: Pennsylvania
FYI

I pasted some of the starter code here for the WSUS info [url]http://www.open-audit.org/phpBB3/viewtopic.php?f=10&t=2576&p=11809#p11809[/url]. Still not complete though :oops: .


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 21, 2008 12:43 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Hoping someone (eduardo, Andrew etc.) can finish this up. I will not have the time to look at this for a while due to work/school obligations:

Getting the DSNs/WSUS settings are done, just modifying the DB and upload scripts to do. thanks musket for the WSUS part:

[code]
'''''''''''''''''''''''''''
'ODBC Connections '
'''''''''''''''''''''''''''
if ((ServicePack = "2" AND SystemBuildNumber = "2600") OR (SystemBuildNumber = "3790" AND ServicePack = "1" OR ServicePack = "2") OR (SystemBuildNumber = "6000")) then
comment = "ODBC Connections"
if verbose = "y" then
wscript.echo comment
end if
On Error Resume Next

strKeyPath = "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
oReg.EnumValues HKEY_LOCAL_MACHINE,strKeyPath,arrSubKeys

For Each subkey In arrSubKeys
comment = subkey
wscript.echo "Name: " & comment
odbc_name = subkey
strKeyPath1 = "SOFTWARE\ODBC\ODBC.INI\" & subkey
'comment = strKeyPath1
'wscript.echo comment
oReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath1, arrValueNames, arrValueTypes

For i=0 To UBound(arrValueNames)
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,_
arrValueNames(i),strValue
wscript.echo arrValueNames(i) & ": " & strValue
Next
Next

end if


''''''''''''''''''''''''''''''
'Windows Update Information '
''''''''''''''''''''''''''''''
comment = "Windows Update Settings"
if verbose = "y" then
wscript.echo comment
end if

strKeyPath = "SOFTWARE\Policies\Microsoft\windows\WindowsUpdate"
strValueName = "WUServer"
objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,win_updates_server

if isnull(win_updates_server) then win_updates_server = "" end if
Wscript.echo win_updates_Server


strKeyPath = "SOFTWARE\Policies\Microsoft\windows\WindowsUpdate"
strValueName = "TargetGroup"
objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,win_updates_group

if isnull(win_updates_group) then win_updates_group = "" end if
Wscript.echo win_updates_group


strKeyPath = "SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU"
strValueName = "AUOptions"
objReg.GetDWordValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,win_updates_options

if isnull(win_updates_options) then win_updates_options = "" end if

Select Case win_updates_options
Case "2" win_updates_options = "Notify before downloading any updates and notify again before installing them"
Case "3" win_updates_options = "(Default setting) Download the updates automatically and notify when they are ready to be installed"
Case "4" win_updates_options = "Automatically download updates and install them on the schedule specified"
Case "5" win_updates_options = "Allow local administrators to select the configuration mode that Automatic Updates should notify and install updates"
End Select

Wscript.echo win_updates_options


strKeyPath = "SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU"
strValueName = "ScheduledInstallDay"
objReg.GetDWordValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,win_updates_installday

if isnull(win_updates_installday) then win_updates_installday = "" end if

Select Case win_updates_installday
Case "0" win_updates_installday = "Everday"
Case "1" win_updates_installday = "Every Sunday"
Case "2" win_updates_installday = "Every Monday"
Case "3" win_updates_installday = "Every Tuesday"
Case "4" win_updates_installday = "Every Wednesday"
Case "5" win_updates_installday = "Every Thursday"
Case "6" win_updates_installday = "Every Friday"
Case "7" win_updates_installday = "Every Saturday"
End Select


strKeyPath = "SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU"
strValueName = "ScheduledInstallTime"
objReg.GetDWordValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,win_updates_installtime

if isnull(win_updates_installtime) then win_updates_installtime = "" end if

Select Case win_updates_installtime
Case "0" win_updates_installtime = "12:00 AM"
Case "1" win_updates_installtime = "1:00 AM"
Case "2" win_updates_installtime = "2:00 AM"
Case "3" win_updates_installtime = "3:00 AM"
Case "4" win_updates_installtime = "4:00 AM"
Case "5" win_updates_installtime = "5:00 AM"
Case "6" win_updates_installtime = "6:00 AM"
Case "7" win_updates_installtime = "7:00 AM"
Case "8" win_updates_installtime = "8:00 AM"
Case "9" win_updates_installtime = "9:00 AM"
Case "10" win_updates_installtime = "10:00 AM"
Case "11" win_updates_installtime = "11:00 AM"
Case "12" win_updates_installtime = "12:00 PM"
Case "13" win_updates_installtime = "1:00 PM"
Case "14" win_updates_installtime = "2:00 PM"
Case "15" win_updates_installtime = "3:00 PM"
Case "16" win_updates_installtime = "4:00 PM"
Case "17" win_updates_installtime = "5:00 PM"
Case "18" win_updates_installtime = "6:00 PM"
Case "19" win_updates_installtime = "7:00 PM"
Case "20" win_updates_installtime = "8:00 PM"
Case "21" win_updates_installtime = "9:00 PM"
Case "22" win_updates_installtime = "10:00 PM"
Case "23" win_updates_installtime = "11:00 PM"
End Select

form_input = "Win_updates^^^" & clean(win_updates_server) & "^^^" & clean(win_updates_group) & "^^^" & clean(win_updates_options) _
& "^^^" & clean(win_updates_installday) & "^^^" & clean(win_updates_installtime) & "^^^"
entry form_input,comment,objTextFile,oAdd,oComment
form_input = ""
[/code]

Please see musket's link above for additional work done on WSUS settings.

Here i am now keeping my fingers crossed.

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
PostPosted: Tue May 27, 2008 5:42 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
any chance the ODBC DSNs can be added now?

Need to make DB changes, but the code brings back the results needed.

Thanks

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 30, 2008 9:30 pm 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Hi,

Just wanted to know if this can be given some sort of attention please? The WSUS settings are in. Just the ODBC needs to be done now. I think I have reached as far as I can without having to hack the database.

thanks

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 11, 2008 8:48 pm 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Anyone please? :oops: :cry:

[code]
'''''''''''''''''''''''''''
'ODBC Connections '
'''''''''''''''''''''''''''
if ((ServicePack = "2" AND SystemBuildNumber = "2600") OR (SystemBuildNumber = "3790" AND ServicePack = "1" OR ServicePack = "2") OR (SystemBuildNumber = "6000")) then
comment = "ODBC Connections"
if verbose = "y" then
wscript.echo comment
end if
On Error Resume Next

strKeyPath = "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
oReg.EnumValues HKEY_LOCAL_MACHINE,strKeyPath,arrSubKeys

For Each subkey In arrSubKeys
comment = subkey
wscript.echo "Name: " & comment
odbc_name = subkey
strKeyPath1 = "SOFTWARE\ODBC\ODBC.INI\" & subkey
'comment = strKeyPath1
'wscript.echo comment
oReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath1, arrValueNames, arrValueTypes

For i=0 To UBound(arrValueNames)
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,_
arrValueNames(i),strValue
wscript.echo arrValueNames(i) & ": " & strValue
Next
Next

end if
[/code]

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 12, 2008 12:20 am 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Done... can you test it.

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 12, 2008 7:42 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Hi,

Where is the information written to?

Thanks,

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 12, 2008 8:27 am 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
...nowhere yet, thats the next bit.

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 13, 2008 1:41 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Yup,

Looks good once I uncommented the echoes:

Tested with:
[code]
'
'''''''''''''''''''''''''''
'ODBC Connections '
'''''''''''''''''''''''''''
if ((ServicePack = "2" AND SystemBuildNumber = "2600") OR (SystemBuildNumber = "3790" AND ServicePack = "1" OR ServicePack = "2") OR (SystemBuildNumber = "6000")) then
comment = "ODBC Connections"
if verbose = "y" then
wscript.echo comment
end if
On Error Resume Next

strKeyPath = "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
oReg.EnumValues HKEY_LOCAL_MACHINE,strKeyPath,arrSubKeys

For Each subkey In arrSubKeys
comment = subkey
wscript.echo "Name: " & comment
odbc_name = subkey
strKeyPath1 = "SOFTWARE\ODBC\ODBC.INI\" & subkey
comment = strKeyPath1
wscript.echo comment
oReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath1, arrValueNames, arrValueTypes

For i=0 To UBound(arrValueNames)
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,_
arrValueNames(i),strValue
wscript.echo arrValueNames(i) & ": " & strValue
Next
Next

end if
[/code]

Results:

[code]
ODBC Connections
Name: VisNeticGroupWare
SOFTWARE\ODBC\ODBC.INI\VisNeticGroupWare
Driver: C:\WINNT\System32\odbcjt32.dll
DBQ: C:\Program Files\Deerfield.com\VisNetic MailServer\calendar\Calendar.mdb
DriverId:
FIL: MS Access
SafeTransactions:
UID:
Name: VisNeticChallenge
SOFTWARE\ODBC\ODBC.INI\VisNeticChallenge
Driver: C:\WINNT\System32\odbcjt32.dll
DBQ: C:\Program Files\Deerfield.com\VisNetic MailServer\spam\Challenge.mdb
DriverId:
FIL: MS Access
SafeTransactions:
UID:
Name: PRODADSD
SOFTWARE\ODBC\ODBC.INI\PRODADSD
Database: PRODADSD
Driver: C:\WINDOWS\system32\SQLSRV32.dll
Server: PVD10
Trusted_Connection: Yes
Name: PRODAITM
SOFTWARE\ODBC\ODBC.INI\PRODAITM
[/code]

One thing we can do is expand this line:

[code]
if ((ServicePack = "2" AND SystemBuildNumber = "2600") OR (SystemBuildNumber = "3790" AND ServicePack = "1" OR ServicePack = "2") OR (SystemBuildNumber = "6000")) then
[/code]

To include Win 2000 and higher systems.

Next step pls :)

thanks,

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 13, 2008 1:49 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Please update for proper commenting with verbose="n" on.

[code]
'
'''''''''''''''''''''''''''
'ODBC Connections '
'''''''''''''''''''''''''''
if ((ServicePack = "2" AND SystemBuildNumber = "2600") OR (SystemBuildNumber = "3790" AND ServicePack = "1" OR ServicePack = "2") OR (SystemBuildNumber = "6000")) then
comment = "ODBC Connections"
if verbose = "y" then
wscript.echo comment
end if
On Error Resume Next

strKeyPath = "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
oReg.EnumValues HKEY_LOCAL_MACHINE,strKeyPath,arrSubKeys

For Each subkey In arrSubKeys
comment = subkey
if verbose = "y" then
wscript.echo "Name: " & comment
end if
On Error Resume Next
odbc_name = subkey
strKeyPath1 = "SOFTWARE\ODBC\ODBC.INI\" & subkey
comment = strKeyPath1
if verbose = "y" then
wscript.echo comment
end if
On Error Resume Next
oReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath1, arrValueNames, arrValueTypes
For i=0 To UBound(arrValueNames)
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,_
arrValueNames(i),strValue
if verbose = "y" then
wscript.echo arrValueNames(i) & ": " & strValue
end if
On Error Resume Next
Next
Next

end if
[/code]

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 17, 2008 12:28 pm 
Offline
Contributor

Joined: Fri Jul 04, 2008 6:46 am
Posts: 153
Location: USA - WI
I'm looking forward to this addition :) We have a lot of applications that use DSN's and it would be great to know which machines have what.

_________________
OA Server: Debian Squeeze w/ Apache2
Auditing: 700 Workstations, 250 or so Retail Terminals, about 75 Servers
OS's: Windows XP/2003/2008/2008 R2/Vista/7, Debian
LDAP: Active Directory 2008 R2


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 18, 2008 8:57 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
I'm on holiday for the next week or so, but if anybody else wants to code a view and add the tables, feel free. :wink:

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 06, 2009 10:18 pm 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Hi,

Anyone want to take a crack at piping the output to the DB?

Thanks,

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group