#154870 - 2006-01-11 03:27 AM
Re: @Address
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
one of the peculiarities of WMI is that it sometimes wants the user to local admin.
the PC needs to be WinNT sp4 or better
additionally, do you have the UDF in the script?
|
Top
|
|
|
|
#154871 - 2006-01-11 03:51 AM
Re: @Address
|
tylan
Starting to like KiXtart
Registered: 2005-11-17
Posts: 115
Loc: Johnstown, PA
|
I was the local admin on all three tests, and I do have the UDF in the script.
I'm using Radimus' WMIQuery 2.5.
The WMICheck gave me 5.1.2600.2180 on an XP Pro SP2. This was the system that gave me SYS-1234567890 as the SN. It also gave 5.2.3790.1830 for a 2003 Server SP1. That server gave me a blank for the SN. The other machine that gave me a blank reported 1.50.1085.63 as the WMI version. It's a Win2000 SP4.
|
Top
|
|
|
|
#154874 - 2006-01-11 12:14 PM
Re: @Address
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
true... many older and many 'non-manageable' and the frankensteins will not have that info.
|
Top
|
|
|
|
#154877 - 2006-01-11 02:55 PM
Re: @Address
|
tylan
Starting to like KiXtart
Registered: 2005-11-17
Posts: 115
Loc: Johnstown, PA
|
What if I go back to my original code, but add in some redundancy checks? Code:
$pgmaster="\\somerset-dc\ParInstall\Paragon61\pgmasterlist.ini"
$rc=writeprofilestring($pgmaster,'@WKSTA','Username','@USERID') $rc=writeprofilestring($pgmaster,'@WKSTA','IPAddress','@IPADDRESS0') $rc=writeprofilestring($pgmaster,'@WKSTA','MAC','@ADDRESS') $rc=writeprofilestring($pgmaster,'@WKSTA','Paragon61','Yes') IF EXIST ("C:\PROGRAM FILES\PARAGON61\pgFormUtility.exe") $rc=writeprofilestring($pgmaster,'@WKSTA','Forms','Yes') ELSE $rc=writeprofilestring($pgmaster,'@WKSTA','Forms','No') ENDIF
What could I add to make each computer check the existing entries before adding a new computer name. Maybe an IF statement that checks to see if the computer name exists, and then to look for the mac address, then add itself as new after the mac wasn't found. I really like this simple code but it doesn't allow for computer name changes. If I make MAC Addresses the [section] it will make a double entry if a computer logs in wired then wireless.
|
Top
|
|
|
|
#154878 - 2006-01-16 04:29 PM
Re: @Address
|
tylan
Starting to like KiXtart
Registered: 2005-11-17
Posts: 115
Loc: Johnstown, PA
|
Is my previous post possible? Can you build a simple "database" that checks the MAC and the computer name? I am at a loss and would really appreciate a little more insight on this.
Thanks in advance!
|
Top
|
|
|
|
#154880 - 2006-01-16 06:08 PM
Re: @Address
|
tylan
Starting to like KiXtart
Registered: 2005-11-17
Posts: 115
Loc: Johnstown, PA
|
I'm sorry. The "database" was referring to my last post. I meant can I build some redundancy checks into the INI file I was starting with. I wrapped database in quotes because I know that an INI file surely isn't a database.
So, rather than trying to do multiple checks on the info you are suggesting to go with CPU ID. I remember something with being able to turn off the CPU ID in the bios. That could cause some issues, correct?
|
Top
|
|
|
|
#154883 - 2006-01-16 10:00 PM
Re: @Address
|
tylan
Starting to like KiXtart
Registered: 2005-11-17
Posts: 115
Loc: Johnstown, PA
|
That makes sense. Simple is better.
Does kix even have the ability to delete entries or entire sections from an INI file?
|
Top
|
|
|
|
#154885 - 2006-01-17 04:16 AM
Re: @Address
|
tylan
Starting to like KiXtart
Registered: 2005-11-17
Posts: 115
Loc: Johnstown, PA
|
Can I dare ask how?
I went through the UDFs, but I didn't see anything relevant. Maybe I wasn't looking hard enough.
|
Top
|
|
|
|
#154886 - 2006-01-17 07:22 AM
Re: @Address
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
In the manual
Quote:
WriteProfileString( ) Action: Copies a string to an initialization file. Syntax: WriteProfileString ("file name", "section", "key", "string") Parameters: File name String identifying the initialization file. Section String containing the name of the section of the initialization file where string is copied. If the section does not exist, it is created. The section name is not case-sensitive, and can contain any combination of uppercase and lowercase letters. Key String containing the name of the key to associate with string. If the key does not exist in the specified section, it is created. If this parameter is empty, the entire section, including all entries within the section, is deleted. String String to write to the file. If this parameter is empty, the key identified by key is deleted. Note: On Windows 9x, use of the tab character (\t) is not supported as part of this parameter Remarks: This function is provided for compatibility with 16-bit Windows-based applications. Win32-based applications store initialization information in the registry. Returns: 0 Profile string written Error code Function failed See Also: ReadProfileString( ), ReadLine( ), WriteLine( ) Example: $IniFile=substr('%WINDIR%',1,2)+'\SMS.INI' if exist($IniFile) $rc=writeprofilestring($IniFile,'Sight','Allow Takeover','Yes') $rc=writeprofilestring($IniFile,'Sight','Allow Reboot','Yes') $rc=writeprofilestring($IniFile,'Sight','Allow File Transfer','Yes') $rc=writeprofilestring($IniFile,'Sight','Allow Chat','Yes') $rc=writeprofilestring($IniFile,'Sight','Allow Remote Execute','Yes') endif
|
Top
|
|
|
|
#154888 - 2006-01-17 04:51 PM
Re: @Address
|
tylan
Starting to like KiXtart
Registered: 2005-11-17
Posts: 115
Loc: Johnstown, PA
|
I feel stupid. Thanks for your patience guys!
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
2 registered
(morganw, mole)
and 414 anonymous users online.
|
|
|