The Kenzig

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, October 15, 2010

How would you like to reset your webserver from anyplace. and device, anytime using a Citrix Xenapp Published App?

Posted on 6:06 AM by Unknown
Often times as an administrator you are some place out in the field and you will get a call that your Web Server has crashed for some reason and needs reset. Or you want your helpdesk people to be able to reset the Webserver but not really have access to the actual desktop.

Here is a method I came up with to publish and Icon within Citrix Xenapp to allow an admin or helpdest staff to quickly do an IISReset remotely via Citrix Xenapp application to get your web server back going in most situations.

As a bonus this will give you a log file that gives you an idea when your web server is crashing and people are resetting it so you can research your log files for a fix.
Note that this script assumes that your Citrix Server is on the same network as your webserver.  I haven't tried it using IP addresses instead of a server name, but I suspect it might work as long as you are putting in an account that has admin priveleges on the Webserver in the script)

To get started you will need to do a few things.

Firstly you will have to download PSTools from Microsoft and copy the PSExec.exe file to the root of the Citrix server that you will be publishing the app to. Lets call that server CitrixAdmin henceforth. PSTools is written by Mark Russinovich and can be found at:
Link to information page on PSexec
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

Direct Download Link to PSTools.zip:
http://download.sysinternals.com/Files/PsTools.zip

Download, extract the PSTools zip to a folder on your CitrixAdmin server and then copy the PSExec.exe file in the root of your C: drive. Also copy the PSExec.exe file to the C: drive of your Webserver.

The other thing you will need to do is copy the IISreset command to your C:/ root of your Webserver from the C:\WINDOWS\system32 folder (open a command prompt and type: copy C:\WINDOWS\system32\iisreset.exe c:  or use Windows Explorer to do it)

Next you need to create a simple command batch file on your CitrixAdmin Server that will run your IISReset command on the remote server that we can publish in your Citrix APP farm.

In order for the IISReset and PSExec to run you will need to pick an account with admin priveleges.

Open up Notepad or your favorite text editor and add the following text between the lines:
_________________________________________________________________
Echo This is a script file to reset the Web Server
Echo The web server was reset at %time% %date%>>C:\WebReset.txt

Echo Off
c:\psexec.exe \\web -u administratoracct -p accountpassword c:\iisreset.exe /restart
exit
__________________________________________________________________
Save the file to the C:\ root folder (or another folder of your choosing) on the Citrixadmin server as "resetweb.cmd"



(In the above script you will need to change file://web/ to file://the%20name%20of/ your webserver. You will also need to change the administratoracct text with the account name that has admin priveleges on your Webserver and accountpassword with the password to that account. Note: yes it is open text password but this file will be on your CitrixAdmin server and not out on the web server)

OK so what this little script does is remotely run IISreset on the Webserver from your CitrixAdmin server.  Then it generates a file on the webserver called Webreset.txt that keeps track of the time and date that the script was run. You can even test the script by clicking on it and running it.  It will reset your IIS Web server so be certain that it is during off hours when you test this.

Now all that needs to be done is create a simple published application for the resetweb.cmd script file you created on the CitrixAdmin Server.

As a Citrix Admin you should know how to publish an application but I will give the steps here anyways. 
On your CitrixAdmin find and Open the Citrix Access Management Console and drill down to the Farm applications folder, right click on it and Select New/ Publish Application from the context menu. Proceed as if you are creating a new app by giving it a name, description etc. and go to next screen.  Keep the defaults on the application publishing screen as an application being published from the server and click next.

To set up the application on the Application Location Properties screen all you need do is type in:  C:\resetweb.cmd   into the Command Line field and C:\ into the working directory.  Finish through publishing the app by adding your users you want to be able to reset the web server and thats it! (note if you put the webreset.com into a different directory you will have to modify the command line and working directory with that directory and the psexec.exe file must also be in that directory.

Connect to your Citrix apps via your favorite device and you now will have an icon you can click on to reset your Web server from where ever you are at! And you will have a log file in the root of your webserver that will tell you whenever this is done.

Now that you have done this what other applications/scripts can you think of that you can use PSexec to run commands remotely via a Citrix published app to save on administration time? The possibilities seem endless.
Email ThisBlogThis!Share to XShare to Facebook
Posted in Remote Reset of IIS server, Reset IIS Webserver Remotely with Citrix Xenapp, Using PSexec to run a remote command on a Citrix Server. | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

Categories

  • .psafe
  • 2008 Networking
  • 2008 year end
  • 2008 year in review videos
  • Admin Only
  • Administrator Only
  • adobe acrobat reader 9.0
  • Adobe ConnectNow
  • ADP Etime on Windows Vista
  • ajaxWindows
  • Allow user to reset own sessions
  • annots.api
  • Antivirus
  • Apple IOS 5.0 Upgrade
  • Application Compatibility
  • Apps for iPad
  • Ardence
  • ATT.net mail
  • Bayden Systems
  • Best iPad apps for newbies
  • Camera Sharing
  • Can I delete windows.old folder?
  • can not find desktop icons
  • can't load
  • Change Monitor Resolution
  • Change Resolution Program
  • Citrix
  • Citrix Clients
  • Citrix ICA Client
  • Citrix Presentation Server Web Interface 4.5 Upgrade to Citrix Xenapp Web Interface 5.01
  • Citrix Provisioning Server 5.0
  • Citrix Provisioning Server 5.1
  • Classic Shell Start Menu
  • Classic Start Menu for Windows 8
  • Close Programs After exit
  • close session
  • Close Windows 8 App
  • Closes Processes after exit
  • Cloud Computing
  • Command Line
  • Command Line Tool
  • Command Prompt
  • Community
  • compatibility mode
  • Compatibility View
  • conficker worm; april 1st
  • crash
  • crashes
  • default zoom
  • delete windows.old folder
  • delete windows.old in Windows 8
  • Delprof
  • desktop icons disappeared
  • desktop icons gone
  • desktop icons hidden
  • desktop icons not showing
  • Disable Adobe Flash Autoupdate
  • domain
  • DTV Transition
  • ECN
  • Enterprise
  • Errors in your registry
  • exit processes
  • Explicit Congestion Notification
  • First Time PC
  • Fix QAT issue with roaming profiles
  • Fix Vista
  • Flash Autoupdate
  • Flex Profile Kit
  • Flexible Profiles Kit
  • FlexProfile Kit
  • FlexProfiles
  • Free
  • get rid of windows.old folder in Windows 7
  • Get start menu back on Windows 8
  • Google
  • GoToMeeting
  • GoToMyMeeting
  • Grok
  • Grokking
  • Hacked
  • hard disk latency
  • How to Install a start menu on Windows 8
  • how to install hyper-v 2008
  • Hyper-V
  • Hyper-V 2008
  • Hyper-V Configuration Guide
  • Hyper-V Deployment Guide
  • HyperV
  • I'm A PC
  • ICA Client
  • Icon
  • icons gone windows 7
  • icons gone windows 8
  • icons hidden
  • ICT
  • Image Management
  • Import Bookmarks
  • Import Favorites
  • Internet Connection Tool
  • Internet Explorer
  • Internet Explorer 10
  • Internet Explorer 8
  • IOS 5 upgrade help
  • IOS 5.0 Upgrade
  • IPad 2 IOS Upgrade
  • iPad Apps
  • iPad apps to start with
  • iPad Upgrade tips
  • iPhone upgrade
  • iPod Upgrade
  • ITTV
  • Java
  • keep same zoom level in Internet Explorer
  • Killer Apps for iPad
  • Large Hadron Collider
  • Layers
  • LHC
  • Links on Web Interface
  • Live Mesh
  • Locallow
  • Login Consultants Flex Profile Kit
  • lost desktop icons
  • Mac Vs PC
  • MagicDisk
  • MagicISO
  • Mandatory Profiles
  • Microsoft
  • Microsoft Antivirus
  • Microsoft Certified Technician
  • Microsoft Internet Connection Tool
  • Microsoft Word 2003 Redaction Tool
  • Microsoft Word 2007 Redaction Tool
  • Misunderstood Features
  • Mobile Mesh
  • Morro
  • Mount ISO
  • MSE
  • msvcr80.dll
  • Nicholas Carr
  • Office Live Workspace
  • Office Quick Access Toolbar
  • Online Bookmarks
  • Online Desktop
  • Online Favorites
  • Oops
  • OS
  • Pano Logic
  • Password Safe
  • Password Safe for iOS
  • PasswordSafe
  • passwordsafe for Android
  • PasswordSafe for iOS
  • Passwordsafe for iPad
  • Passwordsafe for iPhone
  • passwordsafe for Windows
  • PowerGUI
  • PowerPack for Citrix
  • PowerPack for Terminal Services
  • Powershell GUI
  • Prevent Flash Autoupdate
  • profiles
  • Project Charles
  • Project VRC
  • Provisioning server for Datacenter 5.1
  • Provisioning Server for Desktops
  • psafe
  • PVS 5.0
  • pwSafe
  • QAT
  • QAT files do not roam
  • Redaction
  • Remote Admin Tools
  • Remote Administrator Toolkit
  • Remote Reset of IIS server
  • remove windows.old in windows8
  • Reset IIS Webserver Remotely with Citrix Xenapp
  • reset user sessions
  • Ripoff
  • roaming
  • Roaming Profiles
  • Run Delprof remotely
  • SBC Communities Link
  • SCAM
  • Screen Sharing
  • Server Core VHD
  • Services Pack 2
  • set default zoom level in Internet Explorer
  • Setting up a new PC
  • Short Code Providers
  • Short Codes
  • Shouting at hard disk
  • SlickRun
  • Snipping Tool
  • Snipping tool for windows xp
  • Snippy
  • Social Bookmarking
  • Sprint
  • Stallman
  • Stephen Colbert
  • stop adobe reader update
  • Stop Flash Autoupdate
  • Stop UAC
  • Suggested iPad Apps
  • Synctoy
  • The big Switch
  • THIN list
  • Thin List Archives
  • TSRunlogoff
  • Turn off UAC
  • TweakUAC
  • UAC
  • unable to load
  • Unable to log you on because your profile could not be loaded
  • Upgrade
  • User Account Control
  • Using PSexec to run a remote command on a Citrix Server.
  • Utility Computing
  • VDI
  • VECD
  • Veeam Software Monitor
  • VHD
  • VI3
  • Virtual Desktop Infrastructure
  • Virtual ISO
  • Virtual Machine Remote Control Client Plus
  • Virtualization
  • Vista
  • Vista Enterprise Centralized Desktop
  • Vista Monitor Resolution
  • Vista networking
  • Vista Resolution
  • Vista User Access Control
  • VMRCplus
  • VMware
  • Web Interface 4.5
  • Web Interface 5.01
  • Web OS
  • Windows 2008 Server with Hyper-V
  • Windows 7
  • Windows 8
  • Windows 8 Classic Shell Start Menu
  • Windows 8 Installation
  • Windows 8 Shortcut
  • Windows 8 Start Menu
  • Windows 8 Tips
  • Windows IT Pro ITTV
  • Windows Security Essentials
  • Windows Server Remote Destop Services 2008
  • Windows Terminal Services
  • Windows Vista
  • Windows XP Snipping Tool
  • WMI Script
  • Word
  • WSE
  • Xenapp
  • Xenapp 5.0
  • Xenapp 5.0 Web Interface Customization
  • XenappPrep Tool
  • XP Resolution
  • Yahoo Mail
  • zoom level default

Blog Archive

  • ►  2013 (2)
    • ►  July (1)
    • ►  March (1)
  • ►  2012 (6)
    • ►  November (2)
    • ►  October (2)
    • ►  September (1)
    • ►  January (1)
  • ►  2011 (3)
    • ►  October (2)
    • ►  September (1)
  • ▼  2010 (3)
    • ▼  October (1)
      • How would you like to reset your webserver from an...
    • ►  April (2)
  • ►  2009 (15)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  March (2)
    • ►  January (8)
  • ►  2008 (114)
    • ►  December (5)
    • ►  November (7)
    • ►  October (15)
    • ►  September (13)
    • ►  August (12)
    • ►  July (4)
    • ►  June (13)
    • ►  May (20)
    • ►  April (10)
    • ►  March (9)
    • ►  February (4)
    • ►  January (2)
  • ►  2007 (48)
    • ►  September (2)
    • ►  August (1)
    • ►  July (7)
    • ►  June (3)
    • ►  May (5)
    • ►  April (3)
    • ►  March (11)
    • ►  February (6)
    • ►  January (10)
  • ►  2006 (81)
    • ►  December (3)
    • ►  November (10)
    • ►  October (15)
    • ►  September (4)
    • ►  August (8)
    • ►  July (8)
    • ►  June (6)
    • ►  May (2)
    • ►  April (2)
    • ►  March (4)
    • ►  February (4)
    • ►  January (15)
  • ►  2005 (26)
    • ►  December (9)
    • ►  October (3)
    • ►  September (8)
    • ►  August (6)
Powered by Blogger.

About Me

Unknown
View my complete profile