Edit:
I see from your comments that you aren't doing the "poor man's trust relationship" with local accounts, but rather are pre-caching credentials on the client computers before shipping them off-site.
With that in mind, you still really, really want a site-to-site VPN solution, rather than running VPN clients on each client computer. That will make the question you're asking be a moot point. Your client computers won't "know" that there's a VPN present, and things like domain logons and group policy, as well as password changes will "just work".
My eyes are nearly bleeding even thinking about having to deal with no site-to-site VPN and cached credentials on client computers in such an environment.
It is possible to query the domain for this, the script below will tell you when a particular machine's domain password was last reset.
'Replace "yourdom.com" with your domain name.
DomainName = "yourdom.com"
querymachine = UCase(inputbox("Enter full machine name"))
lngBias = 2
'****************Setup Log file******************************************************
Set fso = CreateObject("Scripting.FileSystemObject")
'The 8 in this line will append to an existing file, replace with a 2 to override
set txtStream = fso.OpenTextFile("System.txt", 8, True)
txtStream.WriteLine "Ran on " & Date & " *******************************"
'****************Setup ADSI connection and populate ADSI Collection******************
Set objADOconnADSI = CreateObject("ADODB.Connection")
objADOconnADSI.Open "Provider=ADsDSOObject;"
Set objCommandADSI = CreateObject("ADODB.Command")
objCommandADSI.ActiveConnection = objADOconnADSI
'there is a 1000 object default if these next 2 lines are omited.
objCommandADSI.Properties("Size Limit")= 100000
objCommandADSI.Properties("Page Size")= 100000
objCommandADSI.Properties("Sort on") = "sAMAccountName"
objCommandADSI.CommandText = "<LDAP://" & DomainName & ">;(objectClass=computer);sAMAccountName,pwdLastSet,name,distinguishedname,operatingSystem;subtree"
Set objRSADSI = objCommandADSI.Execute
'Loop through record set and compare machine name*************************************
do while NOT objRSADSI.EOF
if not isnull(objRSADSI.Fields("distinguishedname")) and objRSADSI.Fields("distinguishedname") <> "" then
objDate = objRSADSI.Fields("PwdLastSet")
'Go to function to make sense of the PwdLastSet value from AD for the machine account.
dtmPwdLastSet = Integer8Date(objDate, lngBias)
'calculate the current age of the password.
DiffADate = DateDiff("d", dtmPwdLastSet, Now)
'Is the machine the one we're looking for?
if UCase(objRSADSI.Fields("name")) = querymachine then
txtStream.WriteLine objRSADSI.Fields("name") & ";" & dtmPwdLastSet & ";" & DiffADate & ";" & objRSADSI.Fields("operatingSystem")
wscript.echo objRSADSI.Fields("name") & ", Last set: " & dtmPwdLastSet & ", Days since last change: " & DiffADate
end if
end if
objRSADSI.MoveNext
loop
wscript.echo "Done!"
Function Integer8Date(objDate, lngBias)
' Function to convert Integer8 (64-bit) value to a date, adjusted for
' local time zone bias.
Dim lngAdjust, lngDate, lngHigh, lngLow
lngAdjust = lngBias
lngHigh = objDate.HighPart
lngLow = objdate.LowPart
' Account for bug in IADslargeInteger property methods.
If lngLow < 0 Then
lngHigh = lngHigh + 1
End If
If (lngHigh = 0) And (lngLow = 0) Then
lngAdjust = 0
End If
lngDate = #1/1/1601# + (((lngHigh * (2 ^ 32)) _
+ lngLow) / 600000000 - lngAdjust) / 1440
Integer8Date = CDate(lngDate)
End Function
(I'd love to give credit for the above script but it's been handed around from person to person and modified in various ways, I have no idea where it originally came from)
Save this as something like MachinePasswordDate.vbs, doubleclicking the file in Windows should pop up a box you can put a machine name into, which should then query the domain and tell you when that machine's password was last changed.
If you're regularly restoring virtual machine snapshots it might be worth having a look at the security policies on those machines before you save off an image. You can change the machine password reset interval up to 999 days quite easily, assuming your domain GPOs won't override it, and your security policy allows this sort of thing:
Click Start, click Run, type Gpedit.msc, and then press ENTER.
Expand Local Computer Policy, Computer Configuration, expand Windows Settings, expand Security Settings, expand Local Policies, and then expand Security Options.
Configure the following settings:
Domain Member: Disable machine account password changes (Enabled)
Domain Member: Maximum machine account password age (999 days)
Domain Controller: Refuse machine account password changes (Enabled)
Best Answer
If the XP boxes have been joined to the domain then there is already a machine account for each one. It is maintained by Windows and AD without you having to do anything special. It never expires and works after reboot and without anyone having to log in.
Rather than creating an account per machine matching the machine name why not just rig your job to run as "NT Authority\NetworkService" (FireDaemon works great when you need to turn a program into a service) and let it take care of itself? All you need to do is permit those machines on the other end by adding accounts in the form
DOMAIN\MACHINENAME$
.