psexec \\remotepc -u Domain\User -p Password msiexec /i "pathto.msi switches"

 

To change the timezone from the command line in Windows, type the following at the prompt and press enter. This will open up the timezone setting window from the Control Panel.

RunDLL32 shell32.dll,Control_RunDLL %SystemRoot%\system32\TIMEDATE.cpl,,/Z US Eastern Standard Timep

In a limited access account, (all members of the USER group) you can run this command using Runas.

runas /u:%computername%\administrator cmd

followed by

RunDLL32 shell32.dll,Control_RunDLL %SystemRoot%\system32\TIMEDATE.cpl,,/Z US Eastern Standard Timep

This method works in both XP and Vista.

UPDATE: Or you can also simply type ‘timedate.cpl’ on the command line as an admin to bring up the control panel applet.

[src]

 

The company I work for has been a Windows only shop for a long time and has recently starting moving towards Linux. We’re growing at fast pace and sustaining our operations remaining a Windows shop will be too expensive. That’s not to say we’re completely ditching MS.

I recently put into service a new server running Ubuntu Server 8.04.1 to host our SVN and continuous build server (Hudson). I was looking for a way to authenticate the server against Active Directory and came across Likewise Open. I was surprised at the simplicity of the whole setup.

  1. sudo apt-get install likewise-open
  2. sudo domainjoin-cli join yourdomain.com yourADusername
  3. sudo update-rc.d likewise-open defaults
  4. sudo /etc/init.d/likewise-open start

Just make sure to replace yourdomain.com and yourADusername with your own domain name and active directory username. If you’re using a firewall, which you should be, make sure the required TCP/UDP ports are open.

I still need to figure out how to mount network shares automatically. I’ll keep this post updated with my findings.

 

WMI scripting can be very useful creating filters to selectively apply Group Policies. It can also be used from the command line to get various bits of information about local or remote hosts.

For example, if you want to find out the version of MS Office installed on your PC, you can use the following:
wmic path Win32_Product WHERE (Caption like "%microsoft office%") get Name, Version

On a remote PC:
wmic /node:remote_pcname path Win32_Product WHERE (Caption like "%microsoft office%") get Name, Version

You can even use it to get information from the BIOS
WMIC BIOS Get Manufacturer,Name,Version

List, start, or stop processes.
wmic process get Name
wmic process call create "calc.exe"
wmic process where name="calc.exe" call terminate

Other useful queries:
Shows MAC Addressess of all network adaptors along with the processes controlling them.
wmic /node:PCNAME path Win32_NetworkAdapter get MACAddress, ProductName, ServiceName

This is only the beginning. Here are a few links for reference.
Windows Management Instrumentation Command
Gathering WMI Data without Writing a Single Line of Code
WMI queries from the command line
WMIC Samples
WMI Classess
Win32_BIOS Class
WMI Tasks for Scripts and Applications
Retrieving System Information
Writing WMI Scripts Using the Scriptomatic Utility

© 2012 !NSFW Suffusion theme by Sayontan Sinha