8 Replies Latest reply: Jun 12, 2012 3:33 PM by Vinnie Lima RSS

How to run NSH command after specific time?

Ahmad Ramzi Jamjoom

Hello,

 

I'm a CLM Admin at a customer and I need to automate some aspect in CLM.

In CLM BBSA, there's a NSH script (create_user_windows.nsh) that creates a local user on the provisioned machine.

 

I changed the script to add the machine requestor's account (domain user account) to the "Administrators" group, instead of creating a new loacal user.

It worked fine, but the provisioning failed due to the fact that CLM BBSA does a live browse and checks if a local user was created with the username parameter passed from CLM.

 

I tricked CLM by adding the domain user to the "Administrators" local group and also creating a local user with the same username as the domain user.

 

I need to add another Windows command to the NSH Script that shall delete the local user, but after specific time since CLM BBSA does the live browse after running the NSH script.

 

How can I run a Windows command after sometime on NSH?

 

Below is the NSH script and the command that I need to run after specific time is in red font:

 

-----------------------------------------------------------------------------------------

 

SERVER=$1
USER=$2
PASSWORD=$3
blcli_execute BlValue createEncryptedStringBlValueBean
blcli_execute EncryptedStringBlValueBean parseFromString $PASSWORD >nul
blcli_execute EncryptedStringBlValueBean getClearTextString >nul
blcli_storeenv DECRYPTED_PWD

nexec $SERVER netsh interface ip set dns "Local Area Connection 5" static 10.14.10.13
nexec $SERVER netsh interface ip add dns "Local Area Connection 5" 10.6.10.13 index=2
nexec $SERVER netsh interface ip set dns "Local Area Connection 6" static 10.14.10.13
nexec $SERVER netsh interface ip add dns "Local Area Connection 6" 10.6.10.13 index=2
nexec $SERVER netdom join /d:prod.mobily.lan $SERVER /userd:svc-pvtcloud /passwordd:Pcloud\$321! /uo:svc-pvtcloud /po:Pcloud\$321!
nexec $SERVER net localgroup "Remote Desktop Users" $USER /add
nexec $SERVER net localgroup "Administrators" $USER /add
nexec $SERVER net user $USER clmAdm1n /add

 

 

nexec $SERVER net user $USER /delete

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-----------------------------------------------------------------------------------------

 

Thanks.