Skip navigation

Windows Tips & Tricks UPDATE--September 12, 2005

Make sure your copy of Windows Tips & Tricks UPDATE isn't mistakenly blocked by antispam software! Be sure to add [email protected] to your list of allowed senders and contacts.

This email newsletter comes to you free and is supported by the following advertisers, which offer products and services in which you might be interested. Please take a moment to visit these advertisers' Web sites and show your support for Windows Tips & Tricks UPDATE.

"THE ARGENT GUARDIAN EASILY BEATS OUT MOM IN ALL OUR TESTS"
http://www.tntsoftware.com/wintippri091205


FAQs

  • Q. Are any default Microsoft Systems Management Server (SMS) reports available to help monitor the deployment of an OS via the SMS OS Deployment Feature Pack?
  • Q. How can I run a Control Panel applet or Microsoft Management Console (MMC) snap-in configuration file as another user from the command line?
  • Q. How can I start a process or program as the local system account?
  • Q. How can I use a script to determine a client computer's local site?
  • Q. How can I use a script to generate a list of all IP addresses on a machine?


Sponsor: "THE ARGENT GUARDIAN EASILY BEATS OUT MOM IN ALL OUR TESTS"

Are you searching for an affordable real-time monitoring toolset that will support your proactive system management objectives? Start NOW and download ELM Enterprise Manager from TNT Software. Within an hour, you will experience for yourself why ELM is recognized as the tool that will benefit any System Administrator. Before the 30 Day full feature trial is completed, the Monitoring, Alerting and Reporting will have saved you time and provided you the data for prompt corrective action. Be Proactive; and download ELM Enterprise Manager from the link below:
http://www.tntsoftware.com/wintippri091205


FAQs

Q. Are any default Microsoft Systems Management Server (SMS) reports available to help monitor the deployment of an OS via the SMS OS Deployment Feature Pack?

A. The standard SMS "Advertisement status messages for a particular client and advertisement" report gives details about an OS deployment, including when the phases were performed and the actions within each phase. To view the report, perform the following steps:

  1. Select the "Advertisement status messages for a particular client and advertisement" report via the reports Web site (e.g. http://<sms report site server>/SMSReporting_<site name>/Reports.asp).
  2. Select the OS advertisement and the machine name whose deployment you want to check and click the Display button, as the figure shows.
  3. You'll see a detailed report about the OS deployment. For each item, you can expand the detail by clicking the shortcut arrow icon in the left column, as the figure shows.

Q. How can I run a Control Panel applet or snap-in configuration as another user from the command line?

A. Normal best practice for administrators is to log on under a user account and, as needed, use Runas or Winternals' Psexec utility (which you can download at http://www.sysinternals.com/Utilities/PsExec.html) to run programs with Administrator privileges. However, you can't use this method to run some items (e.g., .cpl and .msc files). To work around this limitation, you can use the Psexec utility and call the file by adding a "cmd /c start" prefix to the command. For example, the following code will fail to run the System Control Panel applet:

  C:\WINDOWS>psexec -d -i -e -u Administrator sysdm.cpl   

However, if you add "cmd /c start" to the command, as the following example shows, the command will run the applet.

  C:\WINDOWS>psexec -d -i -e -u Administrator cmd /c start sysdm.cpl  

You could include such commands in batch files and place the files on your desktop/menus for fast access to the applications within the correct user context.

Q. How can I start a process or program as the local system account?

A. In the FAQs, "How do I schedule commands?" (http://www.windowsitpro.com/Article/ArticleID/15153/15153.html ) and " I am unable to stop a process from Task Manager even though I'm an Administrator, what can I do?" ( http://www.windowsitpro.com/Article/ArticleID/14613/14613.html ), I explain how to submit a command by using the scheduler service with the /interactive switch to start a program. Because the scheduler service runs as the local system, the program would also run with local system credentials. With Winternals' Psexec utility (which you can download at http://www.sysinternals.com/Utilities/PsExec.html), you can use the -s switch to run a program as the system account. The following example shows how to start a cmd.exe session under the system account:

  whoami  SAVILLTECH\john    

psexec -s cmd.exe

PsExec v1.60 - Execute processes remotely Copyright (C) 2001-2005 Mark Russinovich Sysinternals - www.sysinternals.com

Microsoft Windows XP \[Version 5.1.2600\] (C) Copyright 1985-2001 Microsoft Corp.

C:\WINDOWS\system32>whoami NT AUTHORITY\SYSTEM

C:\WINDOWS\system32>exit cmd.exe exited on WKSSAVD800 with error code 0.

When you use the -s switch, Psexec temporarily installs on the computer a service named "psexec running psexesvc.exe" which is removed after the application running as system is closed. Thus to run under the system context, you'll need permissions to install services.

Q. How can I use a script to determine a client computer's local site?

A. To return the current site of a computer, you can use the ADSystemInfo object to call the GetDCSiteName function, as the following code shows:

    

Dim sys

  Set sys = CreateObject("ADSystemInfo")  wscript.echo "Domain Controller site: " & sys.GetDCSiteName(".")  
which you can see running as follows:
  D:\temp>cscript getsite.vbs  Microsoft (R) Windows Script Host Version 5.6  Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.    

Domain Controller site: Smallville

Q. How can I use a script to generate a list of all IP addresses on a machine?

A. The following script will write to screen each IP address on a client.

    

Option Explicit Dim IPConfigSet, IPConfig, I

set IPConfigSet = GetObject("winmgmts:\{impersonationLevel=impersonate\}!root\cimv2"). _ ExecQuery("SELECT IPAddress, DefaultIPGateway FROM " & _ "Win32_NetworkAdapterConfiguration WHERE IPEnabled=TRUE") for each IPConfig in IPConfigSet if Not IsNull(IPConfig.IPAddress) then wscript.echo IPConfig.IPAddress(i) end if next

The output below shows a sample execution.

  D:\temp>cscript listip.vbs  Microsoft (R) Windows Script Host Version 5.6  Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.    

10.10.15.105 192.168.1.57

Events and Resources
(A complete Web and live events directory brought to you by Windows IT Pro: http://www.windowsitpro.com/events )

  • Windows Connections 2005 Conference - October 31 - November 3, 2005

  • At the Manchester Grand Hyatt in San Diego, Microsoft and Windows experts present over 40 in-depth sessions with real-world solutions you can take back and apply today. Register now to save $100 off your conference registration and attend sessions at Microsoft Exchange Connections free!
    http://www.winconnections.com

  • Identify the Key Security Considerations For Wireless Mobility

  • Wireless and mobile technologies are enabling enterprises to gain a competitive advantage through accelerated responsiveness and increased productivity. In this free, on-demand Web seminar you'll receive a checklist of risks to factor in when considering your wireless mobility technology evaluations and design. Sign up today and learn all you need to know about firewall security, transmission security, OTA management, management of third-party security applications and more!
    http://www.windowsitpro.com/seminars/mobilesecurity/index.cfm?code=0914emailannc

  • Get Ready for SQL Server 2005 Roadshow in Europe

  • Back By Popular Demand - Get the facts about migrating to SQL Server 2005! SQL Server experts will present real-world information about administration, development, and business intelligence to help you implement a best-practices migration to SQL Server 2005 and improve your database-computing environment. Receive a one-year membership to PASS and one-year subscription to SQL Server Magazine. Register now!
    http://www.windowsitpro.com/roadshows/sqlservereurope/index.cfm?code=0914emailannc

  • Discover SQL Server 2005 for the Enterprise. Are you prepared?

  • In this free, half-day event you'll learn how the top new features of SQL Server 2005 will help you create and manage large-scale, mission-critical, enterprise database applications--making your job easier. Find out how to leverage SQL Server 2005's new capabilities to best support your business initiatives. Register today!
    http://www.windowsitpro.com/roadshows/sqlserverdba/index.cfm?code=0914emailannc

  • Cut Your Windows XP Migration Time by 60% or More!

  • If your organization is considering -- or has already begun migrating your operating system to Windows XP, then this Web seminar is for you. Sign up for this free event and you'll learn how to efficiently migrate your applications into the Windows Installer (MSI) format and prepare them for error-free deployment and what steps you need to package your applications quickly and correctly and more!
    http://www.windowsitpro.com/go/seminars/WindowsXP/?partnerref=0914emailannc

    Featured White Paper
    (from Windows IT Pro and its partners)

  • How to Solve the Anti-Spam Dilemma

  • In this free white paper learn why older spam prevention technologies using traditional content filtering don't work against the latest spammer tactics -- and why more corporate email administrators are turning to a managed email security service. Discover how to achieve email security with multiple layer protection, minimize false positives, cut email administration costs and keep user communities happy and productive. Download your copy today!
    http://www.windowsitpro.com/whitepapers/postini/managedservice/index.cfm?code=0914emailannc

    Announcements
    (from Windows IT Pro and its partners)

  • Get All the Scripting Answers You Need

  • If you haven't seen the Windows Scripting Solutions newsletter, you're missing out on an exclusive monthly resource that shows you how to automate time-consuming administrative tasks by using our expert-reviewed downloadable code and scripting techniques. Subscribe now and find out how you can save both time and money. Plus, get online access to our popular "Shell Scripting 101" series--click here:
    https://store.pentontech.com/index.cfm?s=1&promocode=eu2659us

  • SQL Server Magazine Has What IT Professionals Need

  • Get SQL Server Magazine and get answers! Subscribe today and get an entire year for just $39.95 -- that's 44% off the cover price. You'll also gain exclusive access to the entire SQL Server Magazine article database (over 2,300 articles) and get the Top SQL Tips handbook (over 60 helpful tips) FREE. This is a limited-time, risk-free offer, so click here now:
    https://store.pentontech.com/index.cfm?s=9&promocode=eu2159u2

    Sponsored Link

  • Argent Versus MOM 2005

  • Download Argent Versus Microsoft Operations Manager 2005
    http://a.windowsitpro.com/RealMedia/ads/click_lx.ads/www.windowsitpro.com/TextLink/1112745096/x14/Penton/WN_Argent_Sept05_NLSplink116195/1x1.gif/1

  • Is Your Office Truly Fax Integrated?

  • Download this free whitepaper from Faxback and find out!
    http://www.windowsitpro.com/whitepapers/faxback/officefax/index.cfm?code=NLsplink

    Contact Us
    Here's how to reach us with your comments and questions:

    This email newsletter is brought to you by Windows IT Pro, the leading publication for IT professionals deploying Windows and related technologies. Subscribe today.
    https://store.pentontech.com/index.cfm?s=1&promocode=eu205xxb

    Hide comments

    Comments

    • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

    Plain text

    • No HTML tags allowed.
    • Web page addresses and e-mail addresses turn into links automatically.
    • Lines and paragraphs break automatically.
    Publish