Sunday, October 14, 2007

Managing Windows 2008 Server Core Local Settings

To add hardware to Windows Server 2008
1.If the driver for the hardware is included in Windows Server 2008, Plug and Play will start automatically and install the driver.
2.At a command prompt, open the folder where the driver files are located, and then run the following command:
pnputil -i -a <driverinf>
To add a user to the local Administrators group
1.At a command prompt, type:
net localgroup Administrators /add <domain>\<username>
To remove a user from the local Administrators group
1.At a command prompt, type:
net localgroup Administrators /delete <domain\username>
To disable a device driver
1.At a command prompt, type:
sc delete <service_name>
To obtain a list of drivers that are installed on the server
1.At a command prompt, type:
sc query type= driver
To manage event logs
1.To list event logs type:
wevtutil el
2.To query events in a specified log type:
wevtutil qe /f:text <log name>
3.To export an event log type:
wevtutil epl <log name>
4.To clear an event log type:
wevtutil cl <log name>
To list the running services
1.At a command prompt, type one of the following:
sc query
or
net start
To start a service
1.At a command prompt, type one of the following:
sc start <service name>
or
net start <service name>
To stop a service
1.At a command prompt, type one of the following:

Monday, October 8, 2007

Networking and firewall

At a command prompt, type:

1.Configure your server to use a proxy server.
netsh Winhttp set proxy <Sername>:<port number>

2.Configure your server to bypass the proxy for internet addresses.
netsh winttp set proxy <servername>:<port number>bypass-list="<local>"

3.Display or modify IPSEC configuration.
netsh ipsec

4.Display or modify NAP configuration.
netsh nap

5.Display or modify IP to physical address translation.
arp

6.Display or configure the local routing table.
route

7.View or configure DNS server settings.
nslookup

8.Display protocol statistics and current TCP/IP network connections.
netstat

9.Display protocol statistics and current TCP/IP connections using NetBIOS over TCP/IP (NBT).
nbtstat

10.Display hops for network connections.
pathping

11.Trace hops for network connections.
tracert

12.Display the configuration of the multicast router.
mrinfo

13.Enable remote administration of the firewall.
netsh advfirewall firewall set rule group=”Windows Firewall Remote Management” new enable=yes

Tuesday, September 25, 2007

Configuring Server Core :

1. Logon with blank password.
2. Set local administrator password:
net user administrator new_password
- OR -
net user administrator *
3. Activate the server:
a. Check license status:
Cscript c:\windows\system32\slmgr.vbs -xpr

b. Local activation:
Cscript c:\windows\system32\slmgr.vbs -ato

c. Remote activation:
Cscript c:\windows\system32\slmgr.vbs dc-contoso-01 contoso\administrator p@ssw0rd -ato

d. Activate with user provided activation code:
Cscript c:\windows\system32\slmgr.vbs -atp

e. Help -?

4. Rename the machine:
NETDOM RENAMECOMPUTER %computername% /NewName:DC-CONTOSO-01 /REboot

5. Set IP Properties
a. Get interfaces:
Netsh interface ipv4 show interfaces

b. Note IDX number for each network adapter to be modified.
c. Set Static IP, subnet mask and Default Gateway
netsh interface ipv4 set address name=3 source=static address=192.168.1.1 mask=255.255.255.0 gateway=192.168.1.2

Where:
Name is the number from step 2 above
Address is the static IP address you are setting
Mask is the subnet mask for the IP Address
DefaultGateway is the default gateway

d. To change back to DHCP:
netsh interface ipv4 set address name=3 source=dhcp

6. Configuring DNS Settings:
a. Set the DNS Server address.
netsh interface ipv4 add dnsserver name=3 address=127.0.0.1 index=1
netsh interface ipv4 add dnsserver name=3 address=192.168.0.1 index=2

Where:
Index is the interface number.
Address is the IP address of your DNS server
Index is the ordinal for the DNS address you would like to change.

b. Repeat for each DNS server you want to set, incrementing the index= number each time.
c. To delete a DNS address:
Netsh int ipv4 delete dnsserver index=3 address=192.168.1.2

Setting the display resolution to something useful with Regedit:
Open Regedit,
Find HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video
You'll have to go fishing to find the key for your video adapter
Set DefaultSettings.Xresolution & DefaultSettings.Yresolution to something you monitor will support.
Example:
DefaultSettings.Xresolution = 1152
DefaultSettings.Yresolution = 768
Managing Server Core
Server Core may be manage as follows:
· Locally and remotely with Command Prompt.
· Remotely with Terminal Server.
· Remotely using Windows Remote Shell on Vista or "Longhorn"
· Remotely via MMC snap-ins.

7. Check event logs with wevtutil from Vista or Longhorn:
Wevtutil qe System /f:text /c:1 /rd:true
NOTE: Options and values are case-sensative

8. Complete local configuration tasks with Scregedit.wsf (1217 lines of script!)
a. Enable Terminal Server Remote Admin Mode:
cscript C:\Windows\System32\Scregedit.wsf /ar 0
b. Enable connection by down level TS clients:
cscript C:\Windows\System32\Scregedit.wsf/cs 0
c. Configure the pagefile.
d. Enable automatic updates.
e. Enable error reporting.

Enable and use Windows Remote Shell (WinRS):
a. Enable WinRS on Server Core
WinRM quickconfig

b. Connect with WinRS:
winrs -r:dc-contoso-01 dir c:\windows
winrs -r:dc-contoso-01 wevtutil qe System /f:text /c:15 /rd:true
winrs -r:dc-contoso-01 wevtutil qe System /f:RenderedXml /e:SystemLog /c:15 /rd:true > event.xml

9. Time and International settings:
a. Setting Time:
control timedate.cpl.

b. International Settings:
control intl.cpl

10. Managing Server Core via MMC;
a. If you don't know how to do this, you are in the wrong session.
TIP: if not domain joined, establish a session first:

Net use * file://servername/c$ /u:UserName

Driver Management
11. Installing hardware with and without "in-box" drivers:
If the driver is included in Longhorn Server Core:
a. Add the hardware. PNP will start and do the rest.
Otherwise:
a. Copy the driver files to a temp folder on Server,
b. Execute the following command:
Pnputil –i –a \.inf

c. Restart if needed.

12. List and delete installed drivers:
a. List installed drivers:
sc query type= driver

NOTE: The space after "type=" is a quirk of many tools you'll be using.

b. Delete specified driver:
sc delete service_name

13. Service Propeties
a. Change service parmeters:
Sc config /?
Sc config "RemoteRegistry" start= auto

NOTE: space after "=" sign.