Ran into this really useful bit of VBS to stop or start specific websites in IIS:
To Stop (StopSite1.vbs):
Set IISObj=GetObject("IIS://LocalHost/W3SVC/1")
IISObj.Stop
To Start (StartSite1.vbs):
Set IISObj=GetObject("IIS://LocalHost/W3SVC/1")
IISObj.Start
Just copy the lines into a text file, rename to .vbs and run with: cscript StartSite1.vbs or cscript StopSite1.vbs.
Friday, February 23, 2007
Errorlevels and Windows XP
I was recently playing with a script to do some basica automated failover depending on whether a certain service was running or not and came accross an interesting fact that Windows XP and I think any newer Windows OS younger than Windows 98 doesn't see Errorlevel =0 as success, instead the successful errorlevel is 255.
For instance - to check the Messenger service on a remote computer (you obviously need the correct rights on the remote machine);
sc \\ query Messenger | FIND "STATE" > service_state.txt
type service_state.txt | find "4"
IF ERRORLEVEL 255 GOTO Running
IF ERRORLEVEL 1 GOTO Problem
:Running
echo Service is running
goto end
:Problem
echo Service Problem
goto End
:End
exit
Thought this may be worth posting if someone's having a hard time with errorlevels!
For instance - to check the Messenger service on a remote computer (you obviously need the correct rights on the remote machine);
sc \\
type service_state.txt | find "4"
IF ERRORLEVEL 255 GOTO Running
IF ERRORLEVEL 1 GOTO Problem
:Running
echo Service is running
goto end
:Problem
echo Service Problem
goto End
:End
exit
Thought this may be worth posting if someone's having a hard time with errorlevels!
Monday, February 19, 2007
RPC over HTTPS Problems
I had a problem that I just couldn't solve - check out my google group post:
I'm absolutely stuck. I've been through almost every knowledgebase
article i've found and along the way fixed every error i've come
across (which has pretty much been all of them). I've got a single
exchange server enabled for RPC over HTTPS. I've got a self signed ssl
certificate created via the IIS resource kit using Self SSL which I
have trusted and is called the same as my external url to my owa
server.
I can navigate to owa without getting prompted with certificate
information, and I can go to http:///rpc where i get prompted for
username and password which fails after third attempt where i get an
error: HTTP Error 401.3 - Unauthorized: Access is denied due to an ACL
set on the requested resource.
I've read that even though this error isn't the standard error i
should get, it should not prove to be a problem. I've done an rpc ping
with the following commands:
rpcping -t ncacn_http -s exch_server_name -o RpcProxy=external_url -P
"user,domain,*" -I "user,domain,*" -H 1 -u 10 -a connect -F 3 -v 3 -E -
R none
rpcping -t ncacn_http -s exch_server_name -o RpcProxy=external_url -P
"user,domain,*" -I "user,domain,*" -H 1 -F 3 -a connect -u 10 -v 3 -e
6002
rpcping -t ncacn_http -s exch_server_name -o RpcProxy=external_url -P
"user,domain,*" -I "user,domain,*" -H 1 -F 3 -a connect -u 10 -v 3 -e
6001
rpcping -t ncacn_http -s exch_server_name -o RpcProxy=external_url -P
"user,domain,*" -I "user,domain,*" -H 1 -F 3 -a connect -u 10 -v 3 -e
6004
all come back fine. When connecting i can see Outlook trying to
connect via port 443 (using Active Ports) but nothing at all happens.
When i run outlook /rpcdiag all i see is it trying to connect, but
nothing else.
The server setup is:
1 x Windows 2003 SBS Server - does have exchange 2003 sp2, but is not
running any part of Rpc over HTTPS - we are slowly decomissioning it.
- DC and GC
1 x Windows 2003 R2 Server - Exchange 2003 SP2 - Rpc over HTTPs server
1 x Windows 2003 x64 Server - DC and GC
<
If you get this far and everything is fine, one thing I didn't check were the firewall rules on the client PC. The firewall was allowing connections out from Outlook, but not back in!!! Such a schoolboy thing to do, but didn't believe it. I was using Kerio firewall, but it just wasn't warning me about incoming connections!!!! Frustrating!!!
Also - if using SelfSSL as with the IIS6 Resource Kit, bear in mind teh default certificate is only for 7 days. You can increase this with the /V switch. Check ou tthis site for a great tutorial:
http://www.visualwin.com/SelfSSL/
I'm absolutely stuck. I've been through almost every knowledgebase
article i've found and along the way fixed every error i've come
across (which has pretty much been all of them). I've got a single
exchange server enabled for RPC over HTTPS. I've got a self signed ssl
certificate created via the IIS resource kit using Self SSL which I
have trusted and is called the same as my external url to my owa
server.
I can navigate to owa without getting prompted with certificate
information, and I can go to http://
username and password which fails after third attempt where i get an
error: HTTP Error 401.3 - Unauthorized: Access is denied due to an ACL
set on the requested resource.
I've read that even though this error isn't the standard error i
should get, it should not prove to be a problem. I've done an rpc ping
with the following commands:
rpcping -t ncacn_http -s exch_server_name -o RpcProxy=external_url -P
"user,domain,*" -I "user,domain,*" -H 1 -u 10 -a connect -F 3 -v 3 -E -
R none
rpcping -t ncacn_http -s exch_server_name -o RpcProxy=external_url -P
"user,domain,*" -I "user,domain,*" -H 1 -F 3 -a connect -u 10 -v 3 -e
6002
rpcping -t ncacn_http -s exch_server_name -o RpcProxy=external_url -P
"user,domain,*" -I "user,domain,*" -H 1 -F 3 -a connect -u 10 -v 3 -e
6001
rpcping -t ncacn_http -s exch_server_name -o RpcProxy=external_url -P
"user,domain,*" -I "user,domain,*" -H 1 -F 3 -a connect -u 10 -v 3 -e
6004
all come back fine. When connecting i can see Outlook trying to
connect via port 443 (using Active Ports) but nothing at all happens.
When i run outlook /rpcdiag all i see is it trying to connect, but
nothing else.
The server setup is:
1 x Windows 2003 SBS Server - does have exchange 2003 sp2, but is not
running any part of Rpc over HTTPS - we are slowly decomissioning it.
- DC and GC
1 x Windows 2003 R2 Server - Exchange 2003 SP2 - Rpc over HTTPs server
1 x Windows 2003 x64 Server - DC and GC
<
If you get this far and everything is fine, one thing I didn't check were the firewall rules on the client PC. The firewall was allowing connections out from Outlook, but not back in!!! Such a schoolboy thing to do, but didn't believe it. I was using Kerio firewall, but it just wasn't warning me about incoming connections!!!! Frustrating!!!
Also - if using SelfSSL as with the IIS6 Resource Kit, bear in mind teh default certificate is only for 7 days. You can increase this with the /V switch. Check ou tthis site for a great tutorial:
http://www.visualwin.com/SelfSSL/
Word 2003 Not spell Checking
I got this from:
http://domino.lancs.ac.uk/pub/usghelpdesk.nsf/0/DF1B055703F6261A80256F8F0045EA6C?OpenDocument
>Text Does Not Spell Check - Word 2003
(and possibly Xp Word 2002, 2000, 97)
If the spell checker passes over areas of text and does not pick-up mis-spelt
words it is possible that the text has been marked not to be checked.
To solve this problem do the following:
1. highlight the area which won't spell check.
2. click 'Tools' menu then the 'Language' option, then 'Set Language' option.
3. ensure that 'Do not check spelling or grammar' option is NOT selected.
4. click
The Spell Check should check the area now.
<
With me the case was that this option was selected, but Word was still not spell checking. To solve this, check the 'Do not check spelling or grammar' box, hit ok, and then do the same again and uncheck the box. All fixed.
http://domino.lancs.ac.uk/pub/usghelpdesk.nsf/0/DF1B055703F6261A80256F8F0045EA6C?OpenDocument
>Text Does Not Spell Check - Word 2003
(and possibly Xp Word 2002, 2000, 97)
If the spell checker passes over areas of text and does not pick-up mis-spelt
words it is possible that the text has been marked not to be checked.
To solve this problem do the following:
1. highlight the area which won't spell check.
2. click 'Tools' menu then the 'Language' option, then 'Set Language' option.
3. ensure that 'Do not check spelling or grammar' option is NOT selected.
4. click
The Spell Check should check the area now.
<
With me the case was that this option was selected, but Word was still not spell checking. To solve this, check the 'Do not check spelling or grammar' box, hit ok, and then do the same again and uncheck the box. All fixed.
Subscribe to:
Posts (Atom)