Excel
asked on
batch script help - using if function
Hi, i need help writing part of the batch script to do the following:
1. run nltest /sc_query:domain.name
2. if command returns result:
C:\>nltest /sc_query:domain.name
Flags: 0
Trusted DC Name
Trusted DC Connection Status Status = 1311 0x51f ERROR_NO_LOGON_SERVERS
The command completed successfully
2.1 run another command x
3. if command returns result:
C:\>nltest /sc_query:domain.name
Flags: 10 HAS_IP
Trusted DC Name \\dc.domain.name
Trusted DC Connection Status Status = 0 0x0 NERR_Success
The command completed successfully
3.1 end script, exit
I'd imagine best would be to read line "Trusted DC Name" and if matched or not "Trusted DC Name \\dc.domain.name" do further actions.
Thanks in advance
1. run nltest /sc_query:domain.name
2. if command returns result:
C:\>nltest /sc_query:domain.name
Flags: 0
Trusted DC Name
Trusted DC Connection Status Status = 1311 0x51f ERROR_NO_LOGON_SERVERS
The command completed successfully
2.1 run another command x
3. if command returns result:
C:\>nltest /sc_query:domain.name
Flags: 10 HAS_IP
Trusted DC Name \\dc.domain.name
Trusted DC Connection Status Status = 0 0x0 NERR_Success
The command completed successfully
3.1 end script, exit
I'd imagine best would be to read line "Trusted DC Name" and if matched or not "Trusted DC Name \\dc.domain.name" do further actions.
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER