Command line Citrix

I found myself in the situation where I needed access Citrix user connection information, but the Management Console was not displaying the users. I was in a bit of a bind, and needed to figure out how determine who was logged into what Citrix server in the farm. This led me to the command line.

auditlog – This will display an audit report of all the user logins and logouts. Basically, this queries the Windows event log. There is not /SERVER qualifier, so it looks like this only applies to the server you are logged in to.

There are a number options to the query command. Below are a couple, I have found most useful. All the query commands accept a /SERVER:servername qualifier to view other servers as well.

query farm – This will display all the current servers in the farm.

query process – This will display all the processes for a given user. You can use * to display all the processes on a server.

query user – To display user information.

quser – Displays all the currently connected users on the server. You need to use the /SERVER:servername qualifier to view servers other than the one you are currently logged in to. A simple script can be used to display the users on all the servers.

qwinsta – Display similar information as quser, but not a detailed. For you need to use the /SERVER:servername qualifier as well.

shadow – You use this command to shadow a user. You need to determine the user ID number using one of the query command above.

Updated my theme.

Tonight I finally got around to Readhanging the site a little. I have gone with a new theme to take advantage of some of the updates. Also, I finally got my twitter link on the site. Next, Facebook and Tumblr.

MacOS display network interface configuration (command line)

To display the network interface information for a particular network interface in Snow Leopard (not sure about other versions) use the following:

ipconfig getpacket interface

For example,
# ipconfig getpacket en0
op = BOOTREPLY
htype = 1
flags = 0
hlen = 6
hops = 0
xid = 446704316
secs = 0
ciaddr = 172.18.32.24
yiaddr = 172.18.32.24
siaddr = 0.0.0.0
giaddr = 0.0.0.0
chaddr = 0:1e:c2:f:1b:45
sname = dhcp.domain.com
file =
options:
Options count is 8
dhcp_message_type (uint8): ACK 0x5
server_identifier (ip): 172.18.10.45
lease_time (uint32): 0x15180
subnet_mask (ip): 255.255.0.0
router (ip_mult): {172.18.10.1}
domain_name_server (ip_mult): {172.18.10.65, 172.18.10.66}
domain_name (string): domain.local
end (none):

This gives you much more information than a standard ifconfig command. The command above will display all the current options for the interface. You can narrow this down with the getoption parameter.

Tru64 turn off/on CPUs.

Yes, I know it’s old and retired and nobody cares, but I still have to support a couple Alphas running Tru64 and I always seem to forget this.

To display the status of the CPUs, use the psrinfo command. This will tell you which CPUs are online or offline.

# psrinfo
0 on-line since 01/27/2011 09:35:36
1 on-line since 01/27/2011 09:35:36
2 on-line since 01/27/2011 09:35:36
3 on-line since 01/27/2011 09:35:36
4 on-line since 01/27/2011 09:35:36
5 on-line since 01/27/2011 09:35:36
8 on-line since 01/27/2011 09:35:36
9 on-line since 01/27/2011 09:35:36
12 on-line since 01/27/2011 09:35:36
13 off-line since 01/27/2011 09:53:52

To put a CPU offline or online use the psradm command.

Offline:
# psradm -f CPU NUMBER

For example, when I turn off CPU 13 listed above, I used the following:
# psradm -f 13

Online:
# psradm -n CPU NUMBER

QoS Packet Scheduler – Windows 2008 to Windows 2003

Ran into an interesting issue when accessing a Windows 2003 domain controller from a Windows 2008 server via a gigabit interface connected to gigabit switch.

I was trying to access a Windows 2003 domain controller (HP BL460c) attached to a 1000Mb switch (Cisco 2960) from a Windows 2008 blade server (BL460c) connected to the same 1000Mb switch (Cisco 2960). Performance was terrible. I was having trouble accessing shares on the 2003 DC and the Network Policy Server was not responding to authentication requests when the server had a secure channel to this DC. However, when I had a secure channel to another Windows 2003 DC (HP DL380) connected to a 100Mb switch (Cisco 3550), I had no problems. The solution was to simply install the QoS Packet Scheduler for the Windows 2003 DC (BL460c). This took care of the issue.

Windows 2008 – to display FSMO roles.

The following command will display the current FSMO roles in a domain:

netdom query FSMO

To display the current Primary domain controller in a domain:

netdom query PDC

To display the current domain controllers for a domain:

netdom query DC

To display trust relationships:

netdom query TRUST

Windows 2008 – reset or view sercure channel.

I have used the following to check when domain controller a member server has a secure channel with:

C:\>netdom verify SERVERNAME
The secure channel from SERVERNAMEto the domain DOMAINAME has been verified. Th
e connection
is with the machine \\SERVERNAME.DOMAINNAME.

The command completed successfully.

Furthermore, you can use the following to reset the secure channel:

C:\>NETDOM RESET SERVERNAME
The secure channel from SERVERNAME to the domain DOMAINNAME has been reset. The c
onnection is
with the machine \\SERVERNAME.DOMANANAME.

The command completed successfully.

I have used similar commands on older OSs, but I am not sure if they were part of the install or part of a resource kit. I have tested these on Windows 2008 and Windows 7.

iPhone field test.

To put your iPhone in field test mode, so that you can see the actual signal strength numerically:

Open the phone application.

Enter the following from the keypad: *3001#12345#*

Press call.

This will put in field test mode, and will replace your bar signal strength with the numerical representation.

Evidently, this has been blocked in a recent version of IOS. I did this from a jailbroken IOS version 4.1 (8B117) with baseband 01.59.00.

Samsung Galaxy Tab Reset

Merry Christmas, I got you a new toy.  A Samsung
Galaxy Tab.  Cool.  Let’s’ check out Pandora.  Oopps.  Hard crash.  Can’t turn it on or anything.  Had plenty of battery.  No choice but to reset.

Soft reset:
Hold down the Power, Volume Up and Home buttons at the same time.

Release them when you see the startup screen.

Use the Volume Up and Volume Down to choose an option.  There were four of which I remember “system reboot” and “factory reset”.

Push the Home button to confirm.

Ubuntu – various software management commands

While I have not spent much looking, I have yet to find a way to have Ubuntu 10.4 manage the number kernels it keeps after upgrading. I have had to manually remove older kernels to apply updated versions later.

To list your currently install kernels:

From a Terminal session enter the following:
sudo dpkg -l | grep linux-image | more

To remove kernel packages, enter the following:
sudo apt-get remove linux-image-2.6.xx-yy-generic

Note: You can remove multiple installed kernels by just adding them to the list:
sudo apt-get remove linux-image-2.6.xx-yy-generic linux-image-2.6.xx-zz-generic

To list all installed packages:
dpkg --get-selections

To list all files a package contains:
dpkg -L packagename

To install a package:
dpkg -i packagefilename
For example:
dpkg -i somepackage.deb

To list available packages:
apt-cache search –names-only ‘stringtosearch’

To clear apt cache:
apt-get clean

To update your repository list:
apt-get update

To upgrade one software package:
apt-get install –only-upgrade packagefilename

To upgrade all software packages, if one is available:
apt-get upgrade

To disable a service:
update-rc.d servicename disable

Return top

INFORMATION