Archive

Archive for July, 2008

Sys Admin Appreciation Day:

http://www.sysadminday.com/whatsysadmin.html

What is a Sysadmin:

“When you think of a sysadmin, think of the people who run the servers that help you clean it off, the people who run your backups to make sure your data is safe, the people who bring you the network, the people who monitor it for security — and yes, the person who cleans the virus off your computer and replaces your monitor.”

Happy sysadmin day too all my fellow nerds :)

A

Categories: Fun Tags:

How do i remove the language bar?

The language bar, as handy as Microsoft think it is can cause real hassle in terminal services or Citrix sessions. Seeing a language bar for each opened application is both annoying and confusing… and well lets face it, how often you actually use it?

As the language bar is part on the office installation, i did not want to go fiddling with the installation properties incase it knocked anything else in the office install out of sync but i did need to remove it from 70+ citrix servers without much overhead.

I read an article recently on the citrix forums and it suggested that ctfmon.exe was the owner of the language bar, once i knew this i wrote a script to deny users access to this file, which in turn would block from running.

I decided to use xcacls as a command line utility, i used xcacls to straight out deny members of the users group (locally) to access the file, this is done like this:

xcacls.exe C:\windows\system32\ctfmon.exe /E /d users /Y

if you are using windows 2000, you can copy the xcacls.exe to an network share and run it from there without any issue.

\\server\share\xcacls.exe %SystemRoot%\system32\ctfmon.exe /E /d users /Y

and if you want to hit 60+ servers remotely, use psexec

psexec @servers.txt -u domain\username cmd /c “\\servername\ctx\utils\xcacls.exe %SystemRoot%\system32\ctfmon.exe /E /d users /Y”

Servers.txt would be in the same directory as psexec, and would contain the server names one per line.

I’ve uploaded the script here:

Dell D410 Touchpad on FC9

Couldnt get the touchpad working for weeks, after much digging around it finally works, below is the xorg.conf i used to get it working:

# Xorg configuration created by system-config-display

Section “ServerLayout”
Identifier     “single head configuration”
Screen      0  “Screen0″ 0 0
InputDevice    “Keyboard0″ “CoreKeyboard”
InputDevice    “Mouse2″ “CoreMouse”
EndSection

Section “InputDevice”
#       Option      “Device” “/dev/input/event3″
#       Option      “MaxTapTime” “0″
Identifier  “Mouse2″
Driver      “synaptics”
Option        “Protocol” “auto-dev”
Option        “SendCoreEvents”
Option        “SHMConfig” “yes”
Option        “TapButton1″ “1″
Option        “TapButton2″ “2″
Option        “Emulate3Buttons” “yes”
Option        “LeftEdge” “120″
Option        “RightEdge” “830″
Option        “TopEdge” “120″
Option        “BottomEdge” “600″
Option        “FingerLow” “14″
Option        “FingerHigh” “15″
# Set MaxTapTime to 0 to disable tapping
Option        “MaxTapTime” “180″
Option        “MaxTapMove” “110″
Option        “VertScrollDelta” “20″
Option        “HorizScrollDelta” “20″
Option        “AccelFactor” “0.030″
Option        “MinSpeed” “0.5″
Option        “MaxSpeed” “1.0″
EndSection

Section “InputDevice”

# keyboard added by rhpxl
Identifier  “Keyboard0″
Driver      “kbd”
Option        “XkbModel” “pc105″
Option        “XkbLayout” “gb”
EndSection

Section “Device”
Identifier  “Videocard0″
Driver      “intel”
EndSection

Section “Screen”
Identifier “Screen0″
Device     “Videocard0″
DefaultDepth     24
SubSection “Display”
Viewport   0 0
Depth     24
EndSubSection
EndSection

Categories: Linux Tags:

List Members (and email addresses) of an Active Directory group.

July 9, 2008 Andrew Morgan 1 comment

Recently i was asked to list a: all members of an active directory group, and b: pull their primary email address, leaving me with an end report of username and primary email address.

I used dsget to pull the user information from the group, below is the command i used:

dsget group “cn=Groupname,ou=DLs,ou=Exchange Recipients,dc=ie,dc=domain,dc=company,dc=com” -members >> 1.txt

the above command enumerates the “groupname” group in an ou called dls, in an ou called exchange recipients in the domain ie.domain.company.com. if your ou or domain structure is different trim out (or add) what you need.  The -members at the end of the file will dump only the usernames in FQDN format.

Once the script is run check the current directory for a textfile called 1.txt.  This text file will contain the usernames you need in FQDN format like below:

“CN=Tom Thumb (IE),ou=Dublin,dc=ie,dc=domain,dc=company,dc=com”
“CN=Mike Hunt (IE),ou=Dublin,dc=ie,dc=domain,dc=company,dc=com”

In order to get the email address’es i decided not to try and read from the file, instead i just ran the same command again and piped the results to another dsget query.

dsget group “cn=Groupname,ou=DLs,ou=Exchange Recipients,dc=ie,dc=domain,dc=company,dc=com” -members | dsget user -email >> 2.txt

The above will pull the results we saw in 1.txt, but instead it passes it straight into another query (dsget user -email) and sends those results to a text file. 2.txt should contain the users primary email address:

tom.thumb@company.com
mike.hunt@company.ie

Now simply copy the contents on both text files into neighboring columns in excel and you have your report :)

Getting a systems uptime…

Really simple and quick question, how do you get a windows systems uptime…

Windows XP, Server 2003 & later:

systeminfo | find “System Up Time:”

Pre xp:

psinfo.exe | find “Uptime:”

psinfo can also be used on remote machines, e.g. psinfo \\servername | find “Uptime:”

A

Categories: Administration, Scripting Tags: ,