Tuesday, March 23, 2010
Tuesday, March 16, 2010
How find out a User Login Name
You can use this window server 2003 native command to find out users login details:
DSQUERY USER -name *LastNameOrFirstNameQuestionedUser* | DSGET USER -samid -display
For Example, if we want to find out fawad's login details then the command would be:
DSQUERY USER -name *fawad* | DSGET USER -samid -display
Output Screen from above command:
samid display
FZI Fawad Zikria
dsget succeeded
DSQUERY USER -name *LastNameOrFirstNameQuestionedUser* | DSGET USER -samid -display
For Example, if we want to find out fawad's login details then the command would be:
DSQUERY USER -name *fawad* | DSGET USER -samid -display
Output Screen from above command:
samid display
FZI Fawad Zikria
dsget succeeded
Who is Logged on to a Computer
You can use WMIC command on Window xp pro or later version of OS to find out who is logged on to a computer.
WMIC /Node:RemoteComputerName ComputerSystem Get UserName
For Example:
>WMIC /Node:replicator ComputerSystem Get UserName
UserName
fzk
ske
tet
tue
Above are 4 users who are currently logged on to replicator.
Also, you can use the PSTools to find out who is logged on to a computer remotely by executing the following command:
PSLOGGEDON -L \\Remote ComputerName or PSEXEC file://remotecomputername/ NET NAME
WMIC /Node:RemoteComputerName ComputerSystem Get UserName
For Example:
>WMIC /Node:replicator ComputerSystem Get UserName
UserName
fzk
ske
tet
tue
Above are 4 users who are currently logged on to replicator.
Also, you can use the PSTools to find out who is logged on to a computer remotely by executing the following command:
PSLOGGEDON -L \\Remote ComputerName or PSEXEC file://remotecomputername/ NET NAME
How to List all Domain Controllers on your Domain
Open the CLI and type to following Window Server 2003 native commands:
DSQUERY Server
Otput Screen:
"CN=testserver,CN=Servers,CN=sydney,CN=Sites,CN=Configuration,DC=test,DC=com,DC=au"
"CN=DC1,CN=Servers,CN=Campbelltown,CN=Sites,CN=Configuration,DC=test,DC=com,DC=au"
"CN=DC2,CN=Servers,CN=Campbelltown,CN=Sites,CN=Configuration,DC=test,DC=com,DC=au"
"CN=SDC1,CN=Servers,CN=City,CN=Sites,CN=Configuration,DC=test,DC=com,DC=au"
"CN=SDC2,CN=Servers,CN=City,CN=Sites,CN=Configuration,DC=test,DC=com,DC=au"
or, if you prefer the host names only then type:
DSQUERY Server -o rdn
Output Screen:
testserver
DC1
DC2
SDC1
SDC2
You can also use the below command on window server 2003:
DSQUERY Server
Otput Screen:
"CN=testserver,CN=Servers,CN=sydney,CN=Sites,CN=Configuration,DC=test,DC=com,DC=au"
"CN=DC1,CN=Servers,CN=Campbelltown,CN=Sites,CN=Configuration,DC=test,DC=com,DC=au"
"CN=DC2,CN=Servers,CN=Campbelltown,CN=Sites,CN=Configuration,DC=test,DC=com,DC=au"
"CN=SDC1,CN=Servers,CN=City,CN=Sites,CN=Configuration,DC=test,DC=com,DC=au"
"CN=SDC2,CN=Servers,CN=City,CN=Sites,CN=Configuration,DC=test,DC=com,DC=au"
or, if you prefer the host names only then type:
DSQUERY Server -o rdn
Output Screen:
testserver
DC1
DC2
SDC1
SDC2
You can also use the below command on window server 2003:
nltest /dclist:DomainName
For example:
nltest /dclist:test.com.au
Wednesday, March 3, 2010
Monday, March 1, 2010
How to Change Windows Local Administrator’s Password Remotely via CLI
In order to change a local user’s password in the computer being used, we can run this command:
net user username newpassword
But to change a local user’s password in another computer, first of all you need to have a administrator privileges and then need to make connection to the IPC$ of the computer.
Use this command to establish a IPC connection:
net use \\computer_name\ipc$ /user:administrator
Press Enter and then enter the administrator’s password when prompted.
For Example : To change the administrator’s password of the computer called vmcitrix04:
net use \\vmcitrix04\ipc$ /user:administrator
Local name
Remote name \\vmcitrix04\ipc$
Resource type IPC
Status Disconnected
# Opens 0
# Connections 1
The command completed successfully.
But if we want to automate the service to change the local administrator’s password or to schedule the task for later, then we need to find out the time on the computer. So, we need the current time on the computer by using this command :
net time \\vmcitrix04
Current time at \\vmcitrix04 is 3/1/2010 4:19 PM
The command completed successfully.
Finally, use the below cmd format to schedule the task at 4:22 using this command:
at \\vmcitrix04 4:22 cmd /c net user administrator testing
Added a new job with job ID = 1
The job is scheduled to run on vmcitrix04 at 4:22 by changing the local administrator password to testing.
net user username newpassword
But to change a local user’s password in another computer, first of all you need to have a administrator privileges and then need to make connection to the IPC$ of the computer.
Use this command to establish a IPC connection:
net use \\computer_name\ipc$ /user:administrator
Press Enter and then enter the administrator’s password when prompted.
For Example : To change the administrator’s password of the computer called vmcitrix04:
net use \\vmcitrix04\ipc$ /user:administrator
Local name
Remote name \\vmcitrix04\ipc$
Resource type IPC
Status Disconnected
# Opens 0
# Connections 1
The command completed successfully.
But if we want to automate the service to change the local administrator’s password or to schedule the task for later, then we need to find out the time on the computer. So, we need the current time on the computer by using this command :
net time \\vmcitrix04
Current time at \\vmcitrix04 is 3/1/2010 4:19 PM
The command completed successfully.
Finally, use the below cmd format to schedule the task at 4:22 using this command:
at \\vmcitrix04 4:22 cmd /c net user administrator testing
Added a new job with job ID = 1
The job is scheduled to run on vmcitrix04 at 4:22 by changing the local administrator password to testing.
Subscribe to:
Posts (Atom)