Tips and Tricks Vol. 4

Some of these may be repeats, but this is a pretty complete list of common tasks an administrator might need to do that either don't have a well known command line tool or a tool at all. A few of these may not work in current builds, such as oclist, but should be in the next build available.

To activate:

Cscript slmgr.vbs –ato

Determining the computer name, any of the following:

            Set c

            Ipconfig /all

            Systeminfo

Rename the Server Core computer:

Domain joined:

Netdom renamecomputer %computername% /NewName:new-name /UserD:domain-username /PasswordD:*

            Not domain joined:

Netdom renamecomputer %computername% /NewName:new-name

Changing workgroups:

Wmic computersystem where name=”<computer name>” call joindomainorworkgroup name=”<new workgroup name>”

Install a role or optional feature:

Start /w Ocsetup <packagename>

Note: For Active Directory, run Dcpromo

View role and optional feature package names and current installation state:

oclist

Start task manager hot-key:

ctrl-shift-esc

Logoff of a Terminal Services session:

            Logoff

To set the pagefile size:

Disable system pagefile management:

wmic computersystem where name=”<computername>” set AutomaticManagedPagefile=False

Configure the pagefile:

wmic pagefileset where name=”C:\\pagefile.sys” set InitialSize=500,MaximumSize=1000

Manually installing a management tool or agent:

Msiexec.exe /i <msipackage>

List installed msi applications:

Wmic

            product

Uninstall msi applications:

Wmic product get name /value

Wmic product where name=”<name>” call uninstall

To list installed drivers:

Sc query type= driver

Installing a driver that is not included:

Copy the driver files to Server Core

Pnputil –i –a <path>\<driver>.inf

Determining a file’s version:

wmic datafile where name="d:\\windows\\system32\\ntdll.dll" get version

List of installed patches:

wmic qfe list

Installing a patch:

Wusa.exe <patchname>.msu /quiet