Documentos de Académico
Documentos de Profesional
Documentos de Cultura
on/connected to a server?
Sometimes we may need to know how many users are logged on to a (file) server, like
maybe when there is a performance degradation.
At the server's console itself, with native commands only:
NET SESSION | FIND /C "\\"
Remotely, with the help of SysInternals' PSTools:
PSEXEC \\servername NET SESSION | FIND /C "\\"
By replacing FIND /C "\\" by FIND "\\" (removing the /C switch) you'll get a list of
logged on users instead of just the number of users.
My collegues often forget to mention their logon account name when calling the helpdesk,
and the helpdesk doesn't always ask either. I suppose they expect me to know all 1500+
accounts by heart.
With (native) Windows Server 2003 commands only:
DSQUERY USER -name *lastname* | DSGET USER -samid -display
Note: Windows Server 2003's "DSTools" will work fine in Windows 2000 and XP too, when
copied.
Keep in mind, however, that some Windows Server 2003 Active Directory
functionality is not available in Windows 2000 Active Directories.
In Windows NT 4 and later, users usually are members of global groups. These global
groups in turn are members of (domain) local groups. Access permissions are given to
(domain) local groups.
To check if a user has access to a resource, we need to check group membership
recursively.
With (native) Windows Server 2003 commands:
DSQUERY USER -samid loginname | DSGET USER -memberof -expand
One could use the previous command to check what permissions a user has on a certain
directory.
However, sometimes SHOWACLS from the Window Server 2003 Resource Kit Tools is a
better alternative:
CD /D d:\directory2check
SHOWACLS /U:domain\userid