Posts

Showing posts from 2010

CTX127043

Hi Check out my latest CTX article. It is a small case study on how to use the seamless flags to troubleshoot an application which is not working as desired in seamless. http://support.citrix.com/article/CTX127043 Enjoy! Sam

Optimising Battery

Hi Whilst preparing my media for a long haul flight I have coming up recently, I wanted to make sure I got every last drop of energy out of my laptop battery before it ran out. What I wanted to do was have a script which closed all applications which are not required to run. All I want is to be able to watch VLC, but I have a number of programs which are running in the background on startup e.g. Dropbox. Obviously this is no use to me on a plane so why leave it running and have it wasting CPU resource? I first of all found this useful article at Lifehacker for quitting all applications http://lifehacker.com/5670054/create-a-shortcut-that-quits-every-running-windows-program The second thing I wanted this script to do was to change the power management profile to my super battery saving mode. Windows 7 gives you loads of options to tweak this how you see fit. I used the powercfg command to set the profile. More details on this can be found here http://technet.microsoft.com/en-us/libr

CTX127078

Hi Check out my latest addition to the Citrix KB site http://support.citrix.com/article/CTX127078 This technote discusses problems related to window positioning on reconnect to XenDesktop 4 VDAs. Sam Google +

Create XenDesktop 4 administrator through MFCOM

Hello there XenApp 6 removes MFCOM and replaces it with a full set of powershell SDKs which make scripting tasks far easier to complete. I was asked to create a script to add a Citrix Administrator for a XenDesktop 4. This was actually easier than I had initially thought. The complexity with this task revolves around the granularity that Citrix administrators have with XenApp. Fortunately there are only a couple of options to configure for XenDesktop. The below powershell script adds the user administrator from the domain SAMO2 to be a full administrator. To change this to a Delegated administrator change AdminType to 2. $mfFarm = New-object -com "MetaframeCOM.MetaFrameFarm" $mfFarm.Initialize(1) $newadmin=$mfFarm.addadmin() $newadmin.AccountName = "Administrator" $newadmin.AccountType = 2 $newadmin.AAName = "SAMO2" $newadmin.AAType = 3 $newadmin.Enable = 1 $newadmin.AdminType = 3 $newadmin = $newadmin $newadmin.savedata() Cheers Sam Google +

Nike+ is awesome

I have been looking to start exercising again recently as I have seen my weight slightly creep up and more importantly my general fitness has been pretty poor. I had to walk up the stairs at a Tube station in London due to the escalators being broken and I was out of breathe at the top. This was the straw that broke the camels back. For my birthday I asked my girlfriend for Nike+. It is a system which has a sensor in your shoe and this connects to either a iPod nano, iPhone, iPod touch or Nike wrist band. This collects data on distance run, time, calories burnt etc. I wasn't quite sure what to expect when I got this for iPod Nano but I was pleasantly surprised. I hooked up the sensor (hidden beneath the left trainer of my Nike+s) to test it and it looked great. You can get feedback on how far you have run, and current pace. Brilliant! The best bit about this though is the community feel at the Nike+ site. When you sync your iPod it will send your results to Nike+ if you cho

List Add/Remove Programs on Remote Computer

Quite a handy little script for listing programs showing as installed on a remote location without having to check the registry. Modify the computer name in the script. To output the file to a text file, run from dos with a >c:\output.txt command. __________ On Error Resume Next Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20 arrComputers = Array("COMPUTERNAMEHERE") For Each strComputer In arrComputers WScript.Echo WScript.Echo "==========================================" WScript.Echo "Computer: " & strComputer WScript.Echo "==========================================" Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32Reg_AddRemovePrograms", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem In colItems WScript.Echo "DisplayName: "

Running a process on a remote machine SILENTLY

Below is the contents of a script to run a process on a remote workstation. It will only run the program silently in the background. As you can't interact this is obviously only recommended to be run on processes which don't require any interaction. The process will run as the user you run the VBS script as, on the workstation specified in the script. ________ strComputer = "remotecomputername" strCommand = "notepad.exe" Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set objProcess = objWMIService.Get("Win32_Process") errReturn = objProcess.Create(strCommand, null, null, intProcessID) If errReturn = 0 Then Wscript.Echo "notepad.exe was started with a process ID: " & intProcessID Else Wscript.Echo "notepad.exe could not be started due to error: " & errReturn End If __________

GP Templates for disabling removable devices

Below is a template for additional group policies for enabling/disabling removable devices and detailed in http://support.microsoft.com/kb/555324 Details of how to import the template into a Group Policy are in http://support.microsoft.com/kb/323639 under How to Load the Administrative Template. You may need to select View and untick Show Policies Only for the options to appear under the custom template folder. __________________ CLASS MACHINE CATEGORY !!category CATEGORY !!categoryname POLICY !!policynameusb KEYNAME "SYSTEM\CurrentControlSet\Services\USBSTOR" EXPLAIN !!explaintextusb PART !!labeltextusb DROPDOWNLIST REQUIRED VALUENAME "Start" ITEMLIST NAME !!Disabled VALUE NUMERIC 3 DEFAULT NAME !!Enabled VALUE NUMERIC 4 END ITEMLIST END PART END POLICY POLICY !!policynamecd KEYNAME "SYSTEM\CurrentControlSet\Services\Cdrom" EXPLAIN !!explaintextcd PART !!labeltextcd DROPDOWNLIST R

Forcing the regional settings via Group Policy using custom templates

Forcing the settings via Group Policy using custom templates --------------------- You may want to read up on Group Policy if you're not familiar with it first. Download and a regional setting .adm file (settings below) into C:\WINDOWS\INF on the domain controller. From Active Directory Users and Computers create a new container and place the users to wish to be affected into that container. Create a new group policy, attach it to the container and edit the settings. Note: This is a user configured policy and not a computer policy and will affect all users that are listed in the container that you attach it too. Click on Administrative Templates underneath User Configuration and select Add/Remove Templates . Browse for the File->Open , and select C:\WINDOWS\INF\RegionalSettings.adm . Close the Add/Remove Templates window. From the group policy window select View->Filtering and untick Only show configured policy settings and Only show policy setti

Synching Time with Specific Server

Put the below into a .vbs files which will set client to sync time with specified server... dim wshShell set wshShell = CreateObject("Wscript.Shell") wshShell.Run "net time \\SERVERNAME /set /yes", true

Sybase - Restoring Master Dump Process

Restoring a master dump file into a blank Sybase set-up. Install Sybase. Stop services. Rename your current D:\Sybase\Data\master.dat to .old. Change to D:\Sybase\ASE-12_5\bin in CMD Create an empty master db by typing sqlsrvr -d d:\Sybase\Data\master.dat -z 2k -b 40960 this will create a master device which is 80MB in size. Then make a copy RUN_SQLBOX.bat and called it something like MasterRecover.bat . Run it . This will leave a batch file version of the Sybase service running. Don't close it. Load up another CMD window and connect using isql. The SA password will be blank at this point. You need to set the master DB to use more of the master device in order to load the dump. Type alter database master on default "60M" go You then need to change the Sybase backup server name. Type: update sysservers set srvnetname = "SQLBOX_BS" (or whatever the backup servname should be) where srvname ="SYB_BACKUP" go Start the Sybase

Adding Windows 2008 DC's to Existing Domain

Adding Windows 2008 Domain Controllers ---------------------------------------------------------------- · You will need the Windows 2008 CD. · In order to Add 2008 DC’s, the domain functional level needs to be at least Windows 2000 native. · Check the forest/domain level. If you’re domain is not the root domain in the forest, you may not have sufficient rights to update the forest schema. · You will need to create or use an existing user account which is a member of the following security groups. Enterprise Admins Schema Admins Domain Admins for the domain that contains the schema master. · Log onto the Schema Master DC as a user with the rights specified above. To check the Schema Master role you’ll need to load a DLL by running regsvr32 schmmgmt.dll from command prompt to enable the Schema snap-in. You can then go to Start-Run-> Type MMC ; select File-Add/Remove Snap In and select Active Directory Sc