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.