Exchange 2003 with iPhone

February 5th, 2010 by shiraj

Exchange 2003 with iPhone
Things to remember:
Exchange is SP2 is minimum requirement and install all latest patch is recommended.

Microsoft Exchange 2003 has Service Pack 2 Installed
I would also install .Net framework 3.5 or above as well, as we are dealing with IIS and website.

Test IIS (Internet Information Server) components for proper connectivity (check event log for OMA error)
Open your browser and type:  http://your-exchange-server-external–dns-name/oma
(Outlook Mobile Access) if you are using https then use that https instead of http.
Open your browser and type:  http://your-exchange-server-external–dns-name/exchange
(Outlook Webmail Access) if you are using https then use that https instead of http.

Configure iPhone to your Exchange Server

There only FOUR components that are typically necessary for a proper exchange – iPhone setup

  1. Email Address
  2. Exchange User Id
  3. Exchange Password
  4. Server Address (Also known as Outlook Web Address)

 

If you have error on OMA try the instruction below

Method 2

Important Method 2 should be used only in an environment that has no Exchange Server 2003 front-end server. The registry changes should be made only on the server on which the mailboxes are located.

Create a secondary virtual directory for Exchange that does not require SSL, and then add a registry value to point to the new virtual directory.

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

322756  (http://support.microsoft.com/kb/322756/ ) How to back up and restore the registry in Windows
Note These steps affect both Outlook Mobile Access connections and Exchange ActiveSync connections. After you follow these steps, both Outlook Mobile Access and Exchange ActiveSync connections use the new virtual directory that you create.

Disable the forms-based authentication for the Exchange virtual directory

To create a secondary virtual directory for Exchange that is based on steps 1 through 7 of the following procedure, make sure that forms-based authentication is disabled for the Exchange virtual directory before you make the copy. Before you follow these steps, disable forms-based authentication in Exchange System Manager. Then restart Internet Information Services (IIS). To do this, follow these steps:

  1. Open Exchange Manager.
  2. Expand Administrative Groups, expand the first administrative group, and then expand Servers.
  3. Expand the server container for the Exchange Server 2003 server that you will be configuring, expand Protocols, and then expand HTTP.
  4. Under the HTTP container, right-click the Exchange Virtual Server container, and then click Properties.
  5. Click the Settings tab, clear the Enable Forms Based Authentication check box, and then click OK.
  6. Close Exchange Manager.
  7. Click Start, click Run, type IISRESET/NOFORCE, and then press ENTER to restart Internet Information Services (IIS).

Create a secondary virtual directory for Exchange server

You must use Internet IIS Manager to create this virtual directory for Exchange ActiveSync and Outlook Mobile Access to work. If you are using Windows Server 2003, follow these steps:

  1. Start Internet Information Services (IIS) Manager.
  2. Locate the Exchange virtual directory. The default location is as follows:

Web Sites\Default Web Site\Exchange

  1. Right-click the Exchange virtual directory, click All Tasks, and then click Save Configuration to a File.
  2. In the File name box, type a name. For example, type ExchangeVDir. Click OK.
  3. Right-click the root of this Web site. Typically, this is Default Web Site. Click New, and then click Virtual Directory (from file).
  4. In the Import Configuration dialog box, click Browse, locate the file that you created in step 4, click Open, and then click Read File.
  5. Under Select a configuration to import , click Exchange, and then click OK.

    A dialog box will appear that states that the “virtual directory already exists.”

  6. Select the Create a new virtual directory option. In the Alias box, type a name for the new virtual directory that you want Exchange ActiveSync and Outlook Mobile Access to use. For example, type exchange-oma. Click OK.
  7. Right-click the new virtual directory. In this example, click exchange-oma. Click Properties.

10.  Click the Directory Security tab.

11.  Under Authentication and access control, click Edit.

12.  Make sure that only the following authentication methods are enabled, and then click OK:

  • Integrated Windows authentication
  • Basic authentication

13.  On the Directory Security tab, under IP address and domain name restrictions, click Edit.

14.  Click the option for Denied access, click Add, click Single computer and type the IP address of the server that you are configuring, and then click OK twice.

15.  Under Secure communications, click Edit. Make sure that Require secure channel (SSL) is not enabled, and then click OK.

16.  Click OK, and then close the IIS Manager.

17.  Click Start, click Run, type regedit, and then click OK.

18.  Locate the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MasSync\Parameters

19.  Right-click Parameters, click to New, and then click String Value.

20.  Type ExchangeVDir, and then press ENTER. Right-click ExchangeVDir, and then click Modify.

NoteExchangeVDir is case-sensitive. If you do not type ExchangeVDir exactly as it appears in this article, ActiveSync does not find the key when it locates the exchange-oma folder.

21.  In the Value data box, type the name of the new virtual directory that you created in step 8. For example, type /exchange-oma. Click OK.

22.  Quit Registry Editor.

23.  Restart the IIS Admin service. To do this, follow these steps:

  1. Click Start, click Run, type services.msc, and then click OK.
  2. In the list of services, right-click IIS Admin service, and then click Restart.

24.  If you want to reuse Forms-based Authentication on the Exchange server, follow these steps to re-enable Forms-based Authentication on the /Exchange virtual directory in Exchange System Manager.

  1. Open Exchange Manager.
    1. Expand Administrative Groups, expand the first administrative group, and then expand Servers.
    2. Expand the server container for the Exchange Server 2003 server that you will be configuring, expand Protocols, and then expand HTTP.
    3. Under the HTTP container, right-click the Exchange Virtual Server container, and then click Properties.
    4. Click the Settings tab, click to select the Enable Forms Based Authentication check box, and then click OK.
    5. Close Exchange Manager.
    6. Click Start, click Run, type IISRESET/NOFORCE, and then press ENTER to restart Internet Information Services (IIS).

Note If the server is Microsoft Windows Small Business Server 2003 (SBS), the name of the Exchange OMA virtual directory must be exchange-oma.

The integrated setup of Microsoft Windows Small Business Server 2003 creates the exchange-oma virtual directory in IIS. Additionally, it points the ExchangeVDir registry key to /exchange-oma during the initial installation. Other SBS wizards, such as the Configure E-mail and Internet Connection Wizard (CEICW) also expect the virtual directory name in IIS to be exchange-oma.

DcGetDcName(TIME_SERVER) call failed, error 1355

September 1st, 2009 by shiraj

——–
Warning: DcGetDcName(TIME_SERVER) call failed, error 1355
A Time Server could not be located.
The server holding the PDC role is down.
Warning: DcGetDcName(GOOD_TIME_SERVER_PREFERRED) call failed,
error 1355
A Good Time Server could not be located.
——–

Quick resolution worked for me changing time server:

The procedure for doing this on a PDC Emulator running Windows Server 2003 in the forest root domain is as follows. Open Registry Editor (regedit.exe) and configure the following registry entries:

HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type

This registry entry determines which peers W32Time will accept synchronization from. Change this REG_SZ value from NT5DS to NTP so the PDC Emulator synchronizes from the list of reliable time servers specified in the NtpServer registry entry described below.

HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags

This registry entry controls whether the local computer is marked as a reliable time server (which is only possible if the previous registry entry is set to NTP as described above). Change this REG_DWORD value from 10 to 5 here.

HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\NtpServer

This registry entry specifies a space-delimited list of stratum 1 time servers from which the local computer can obtain reliable time stamps. The list may consist of one or more DNS names or IP addresses (if DNS names are used then you must append ,0×1 to the end of each DNS name). For example, to synchronize the PDC Emulator in your forest root domain with tock.usno.navy.mil, an open-access SNTP time server run by the United States Naval Observatory, change the value of the NtpServer registry entry from time.windows.com,0×1 to tock.usno.navy.mil,0×1 here. Alternatively, you can specify the IP address of this time server, which is 192.5.41.209 instead.

Now stop and restart the Windows Time service using the following commands:

net stop w32time

net start w32time

Disable IPv6 on a Windows Server 2008

August 7th, 2009 by shiraj

To completely disable IPv6 on a Windows Server 2008-based computer yourself, follow these steps:

  1. Open Registry Editor.
  2. Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
  3. In the details pane, click New, and then click DWORD (32-bit) Value.
  4. Type DisabledComponents, and then press ENTER.
  5. Double-click DisabledComponents, and then type 0xffffffff in Hexadecimal or 4294967295 in Decimal.

    Note The 0xffffffff value or the 4294967295 value disables all IPv6 components except for the IPv6 loopback interface.

Immediate Logout after Login into Windows XP

July 21st, 2009 by shiraj

That nasty worm have changed userinit value in Registry…

<long post>


“HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon”
Value: Userinit
Data: %system32%\wsaupdater.exe

%system32% represents the path to the System32 folder. For example, if the path is C:\Windows\System32, then the data would be: “C:\Windows\System32\wsaupdater.exe”

Instead of “wsaupdater.exe”, the data should contain “userinit.exe,”.
Using the example above, the data would be “C:\Windows\System32\userinit.exe,”
(!Note! the comma following the file path information.)

Using the XP’s recovery console, copy userinit.exe to wsaupdater.exe to allow log on capability to be restored, and correct the registry data manually.

In the following instructions, C:\Windows\System32 shall be used as the System32 location. Change the path accordingly to accommodate for your installation directory.

Insert the Windows XP startup disk into the floppy disk drive, or insert the Windows XP CD-ROM into the CD-ROM drive, and then restart the computer.
Click to select any options that are required to start the computer from the CD-ROM drive if you are prompted to do so.

When the “Welcome to Setup” screen appears, press R to start the Recovery Console.
If you have a dual-boot or multiple-boot computer, select the installation that you want to access from the Recovery Console.
When you are prompted to do so, type the Administrator password.

If the administrator password is blank (which is likely the case if Windows XP was preinstalled by your computer manufacturer), just press ENTER.

You should now be in the Windows installation folder (“C:\Windows”).
At the Recovery Console command prompt, type the following lines, pressing ENTER after you type each line:


cd system32
copy userinit.exe wsaupdater.exe
exit

At this time, remove the startup floppy or CD-ROM from your system, and boot into Windows XP. Log on to the system using an account with administrator-level privileges, and edit the registry using this information. It is recommeded that a registry backup be created prior to continuing.

Click start, then run. Enter

regedit

and click OK. Using RegEdit, expand

HKEY_LOCAL_MACHINE
+Software
+Microsoft
+Windows NT
+CurrentVersion
+Winlogon

Locate Userinit in the value column, right-click this item, and choose modify. Replace
“wsaupdater.exe” with “userinit.exe,” (do not use quotes, and ensure the trailing comma is present as shown) and click OK.
Exit RegEdit.

Restart your computer, and log on to the system using an account with administrator-level privileges.

Go to My Computer, then to the System32 folder (usually C:, then Windows, then System32). If Explorer prompts that removing files from these areas is not recommended, click to continue. Locate and remove wsaupdater.exe, and delete this file.

</long post>

manual method to reset TCP/IP

July 10th, 2009 by shiraj

The reset command is available in the IP context of the NetShell utility. Follow these steps to use the reset command to reset TCP/IP manually:

  1. To open a command prompt, click Start and then click Run. Copy and paste (or type) the following command in the Open box and then press ENTER:
    cmd
  2. At the command prompt, copy and paste (or type) the following command and then press ENTER:
    netsh int ip reset c:\resetlog.txt

    Note If you do not want to specify a directory path for the log file, use the following command:

    netsh int ip reset resetlog.txt
  3. Reboot the computer.

You may receive an “Outlook blocked access to the following potentially unsafe attachments” message in Outlook

June 7th, 2009 by shiraj

Follow these steps to modify the registry and change Outlook’s attachment security behavior.

  1. Exit Outlook if it is running.
  2. Click Start, and then click Run. Copy and paste (or type) the following command in the Open box, and then press ENTER:
    regedit
  3. Verify that the following registry key for your version of Outlook exists.Microsoft Office Outlook 2007
    HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security

    Microsoft Office Outlook 2003

    HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security

    Microsoft Outlook 2002

    HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Security

    Microsoft Outlook 2000

    HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Security

    If the registry key exists, go to step 5.

    If the registry key does not exist, follow these steps to create it:

    1. Locate, and then click the following registry key:
      HKEY_CURRENT_USER\Software\Microsoft
    2. Under Edit, click New, and then click Key.
    3. Type Office, and then press ENTER.
    4. Under Edit, click New, and then click Key.
    5. For Outlook 2007, type 12.0, and then press ENTER.
      For Outlook 2003, type 11.0, and then press ENTER.
      For Outlook 2002, type 10.0, and then press ENTER.
      For Outlook 2000, type 9.0, and then press ENTER.
    6. Under Edit, click New, and then click Key.
    7. Type Outlook, and then press ENTER.
    8. Under Edit, click New, and then click Key.
    9. Type Security, and then press ENTER.
  4. Under Edit, click New, and then click String Value.
  5. Copy and paste (or type) the following name for the new value:
    Level1Remove
  6. Press ENTER.
  7. Right-click the new string value name, and then click Modify.
  8. Type the file name extension of the file type that you want to open in Outlook. For example:
    .exe

    To specify multiple file types, use the following format:

    .exe;.com
  9. Click OK.
  10. Exit Registry Editor.
  11. Restart your computer.

When you start Outlook, you can open the file types that you specified in the registry.

http://support.microsoft.com/kb/829982

Remotely Enable Remote Desktop (RDP)

June 5th, 2009 by shiraj

Remote Desktop is a cool feature of Windows Server 2003 that lets you remotely log on to and work at a machine as if you were seated at the local console (in Windows 2000 Advanced Server, this feature was called Terminal Services in Remote Administration Mode). Remote Desktop can be a lifesaver for fixing problems on servers at remote sites, but what if you forgot to enable the feature before you shipped the server out to Kalamazoo? Enabling Remote Desktop is easy if the server is in front of you: just log on as an administrator, open System in Control Panel, select the Remote tab, and under Remote Desktop select the checkbox labeled “Allow users to connect remotely to this computer.” Unfortunately, you can’t use the System utility to enable Remote Desktop on a remote machine, though you can access some properties pages of System using Computer Management by first connecting the console to a remote computer, then right-clicking on the root node and selecting Properties. Unfortunately, as you can see in Figure 1 below, the Remote tab is not available when you access System properties this way on a remote machine (here named SRV220).

Figure 1
Figure 1. System properties for a remote machine does not have Remote tab.

Fortunately, there’s a workaround. Sit down at your desk and log on to your Windows XP workstation using your administrator credentials and start Registry Editor by Start –> Run –> regedit –> OK. Then select the Connect Network Registry option under the File menu (Figure 2).

Figure 2
Figure 2. Connecting to the Registry on a remote machine.

This opens the Select Computer search box. Either browse Active Directory to locate the remote server, or type its name in the textbox (Figure 3).

Figure 3
Figure 3. Connecting to the Registry on a remote server named SRV220.

Click OK and a node will be displayed in Registry Editor for the remote machine (Figure 4).

Figure 4
Figure 4. HKLM and HKU hives on SRV220.

Now browse HKLM on SRV to find the following Registry key (Figure 5).

HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server

Figure 5
Figure 5. Registry key for Terminal Server on remote machine.

Under the Terminal Server key, you’ll find a REG_DWORD value named fDenyTSConnection. Double-click on that value to open the Edit DWORD Value box and change the value data from 1 (Remote Desktop disabled) to 0 (Remote Desktop enabled), as in Figure 6 below.

Figure 6
Figure 6. Set fDenyTSConnections to 0 to enable Remote Desktop on SRV220.

The remote machine needs to be rebooted for the change to take effect, so open a command prompt and type the following command:

shutdown -m \\srv220 -r

After the remote machine reboots, Remote Desktop should be enabled on it. To test this from your workstation, open Start –> All Programs –> Accessories –> Communications –> Remote Desktop Connection, enter the name of the remote server in the Remote Desktop Connection logon box, supply your administrator password when prompted, and you’re in.

Add Printer .bat

May 28th, 2009 by shiraj

If RUNDLL32 just won’t do the job:

Sometimes we need to do just alittle more than RUNDLL32 is capable of, like installing a TCP/IP printer port.
In that case, consider buying yourself a copy of the Windows 2000 Server/Windows Server 2003 Resource Kit and use PRNADMIN.DLL and the accompanying sample scripts written in VBScript.

My own AddIPPrn.bat below uses these VBScripts to install a printer, its driver and a TCP/IP printer port on a remote computer


@ECHO OFF
:: Check Windows version
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
SETLOCAL

:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::                                                                         ::
::    Modify the following lines; no quotes for PrnShort and PortIP!       ::
::                                                                         ::
::    The values for PrnType and TargetOS can be found in the INF file     ::
::    that comes with the (extracted) printer driver.                      ::
::                                                                         ::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::

SET PrnName="Accounting 2nd Floor"
SET PrnShort=Accounting2
SET PrnType="Kyocera Mita FS-3820N"
SET DrvPath="\\server\share\Drivers\Kyocera\FS-3820N\W2K"
SET InfPath="\\server\share\Drivers\Kyocera\FS-3820N\W2K\oemsetup.inf"
SET PortIP=112.113.114.115
SET TargetOS="Windows 2000"

:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::                                                                         ::
::       End of adjustments                                                ::
::                                                                         ::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::

:: Check command line arguments
IF "%~1"=="" GOTO Syntax
SET PC=%~1
ECHO."%PC%" | FINDSTR.EXE /R /C:"[?/]" >NUL && GOTO Syntax
PING.EXE %PC% 2>NUL | FIND.EXE  "TTL=" >NUL || (
	ECHO Computer %PC% is unavailable
	ECHO.
	GOTO Syntax
)

:: Check if the required VBScripts are available in the current directory
SET Error=0
FOR %%A IN (prncfg prnmgr drvmgr portmgr) DO IF NOT EXIST %%A.vbs SET Error=1
IF "%Error%"=="1" GOTO Syntax

:: Check if the printer was installed already
CSCRIPT.EXE //NoLogo prnmgr.vbs -l -c \\%PC% | FIND.EXE /I "%PrnShort%" >NUL && (
	ECHO A printer named %PrnShort% already exists on %PC%
	ECHO.
	GOTO Syntax
)

:: Check if the printer port was installed already
CSCRIPT.EXE //NoLogo portmgr.vbs -l -c \\%PC% | FINDSTR.EXE /E /I "IP_%PortIP%" >NUL && (
	ECHO TCP/IP printer port %PortIP% already exists on %PC%
	ECHO.
	GOTO Syntax
)

:: Prompt the user, and allow him/her to abort the installation
ECHO You are about to add a local printer %PrnShort% on computer %PC%
ECHO.
PAUSE

:: Install the driver
CSCRIPT.EXE //NoLogo drvmgr.vbs  -a -c \\%PC% -p %DrvPath% -i %InfPath% -v %TargetOS% -m %PrnType% -t Intel
:: Install the local IP print port, type raw, SNMP disabled
CSCRIPT.EXE //NoLogo portmgr.vbs -a -c \\%PC% -p IP_%PortIP% -h %PortIP% -t raw -n 9100 -md
:: Install the local printer with the driver and port we just installed
CSCRIPT.EXE //NoLogo prnmgr.vbs  -a -c \\%PC% -b %PrnName% -m %PrnType% -r IP_%PortIP%
:: Configure the local printer as not shared and not published in Active Directory
CSCRIPT.EXE //NoLogo prncfg.vbs  -s -b \\%PC%\%PrnShort% -published -shared

:: Display or log the configuration of the new printer
IF /I "%~2"=="/L" (SET Log="%PrnShort%_%PC%.log") ELSE (SET Log=CON)
(
	CSCRIPT.EXE //NoLogo drvmgr.vbs  -l -c \\%PC%
	CSCRIPT.EXE //NoLogo portmgr.vbs -l -c \\%PC%
	CSCRIPT.EXE //NoLogo prnmgr.vbs  -l -c \\%PC%
	CSCRIPT.EXE //NoLogo prncfg.vbs  -g -b \\%PC%\%PrnShort%
) > %Log% 2>&1

:: Done
GOTO End

:Syntax
ECHO.
ECHO AddIPPrn.bat,  Version 1.01 for Windows 2000 with Server Resource Kit
ECHO Install a (hard coded) local IP printer %PrnShort% on a remote computer
ECHO.
ECHO Usage:  ADDIPPRN.BAT   computername  [ /L ]
ECHO.
ECHO Where:  "computername" is the computer on which the printer should be installed
ECHO         "/L"           logs the results in {printername}_{computername}.log
ECHO                        (default is display on screen)
ECHO.
ECHO Notes:  [1] You need to modify the first couple of lines from this batch file
ECHO             to install your own printer, port and driver. You may then want
ECHO             to save the modified batch file as {printername}.bat.
ECHO         [2] This batch file requires drvmgr.vbs, portmgr.vbs, prnmgr.vbs and
ECHO             prncfg.vbs from the Windows 2000/2003 Server Resource Kit; these
ECHO             scripts must all be located in the current directory.
ECHO         [3] These VBScripts require PRNADMIN.DLL from the Resource Kit to be
ECHO             installed on the computer that runs the scripts.
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com

:End
IF "%OS%"=="Windows_NT" ENDLOCAL

If all you need is to backup/restore, clone or migrate existing printers:

May 28th, 2009 by shiraj

Often the printer configurations of existing computers need to be cloned to other computers, or restored after reinstalling Windows.
In those cases, a backup/export and restore/import with Microsoft’s PrintMig 3.1 may be the best (and easiest) solution.
Though earlier versions of PrintMig were GUI only, version 3.1 can also be run without user interaction from the command line or in a batch file:

Microsoft (R) Windows (TM) Printer Migrator 3.1
Copyright (C) 1997-2002 Microsoft Corp. All rights reserved

usage: PRINTMIG [options] [server]
       [-?] Display this message
       [-b] Backup - followed by CAB file name
       [-r] Restore - followed by CAB file name
       [-l] Attempt to convert LPR Ports to SPM
       [-i] Suppress warning popups.  Info still written to log file.

If server is not specified then the local machine is implied.

Example command line to restore an existing config to a server:
  printmig -r d:\print\ps1.cab \\prt-srvr1

Example command line to backup a server to the specified file:
  printmig -b "\\filesrv\store\print server 2.cab" \\prt-srvr2

Scripting Printer in Windows

May 28th, 2009 by shiraj

in command prompt type: rundll32 printui.dll,PrintUIEntry /?

i.e C:\Documents and Settings\Administrator>rundll32 printui.dll,PrintUIEntry /?

this will show all the usable parameters, as below. PrintUI is the command to search. can be used on batch file and in login script.

Usage: rundll32 printui.dll,PrintUIEntry [options] [@commandfile]
/a[file] binary file name
/b[name] base printer name
/c[name] unc machine name if the action is on a remote machine
/dl delete local printer
/dn delete network printer connection
/dd delete printer driver
/e display printing preferences
/f[file] either inf file or output file
/ga add per machine printer connections
/ge enum per machine printer connections
/gd delete per machine printer connections
/h[arch] driver architecture one of the following, Alpha | Intel | IA64 | x64
/ia install printer driver using inf file
/id install printer driver using add printer driver wizard
/if install printer using inf file
/ii install printer using add printer wizard with an inf file
/il install printer using add printer wizard
/in add network printer connection
/j[provider] print provider name
/k print test page to specified printer, cannot be combined with command when installing a printer
/l[path] printer driver source path
/m[model] printer driver model name
/n[name] printer name
/o display printer queue view
/p display printer properties
/q quiet mode, do not display error messages
/r[port] port name
/s display server properties
/Ss Store printer settings into a file
/Sr Restore printer settings from a file
Store or restore printer settings option flags that must be placed at the end of command:
2    PRINTER_INFO_2
7    PRINTER_INFO_7
c    Color Profile
d    PrinterData
s    Security descriptor
g    Global DevMode
m    Minimal settings
u    User DevMode
r    Resolve name conflicts
f    Force name
p    Resolve port
/u use the existing printer driver if it’s already installed
/t[#] zero based index page to start on
/v[version] driver version one of the following, Windows 95, 98 and Me | Windows NT 4.0 | Windows NT 4.0 or 2000 | Windows 2000 or XP | Windows XP
/w prompt the user for a driver if specified driver is not found in the inf
/y set printer as the default
/Xg get printer settings
/Xs set printer settings
/z do not auto share this printer
/Y do not auto generate a printer name
/K changes the meaning of /v and /h to accept 0,1,2,3, respectively for Windows x64 and Windows IA64 | Windows NT x86 | Windows NT Alpha_AXP | Windows 4.0
/Z share this printer, can only be used with the /if option
/? help this message
@[file] command line argument file
/Mw[message] show a warning message before committing the command
/Mq[message] show a confirmation message before committing the command
/W[flags] specifies flags and switches for the wizards (for APW & APDW)
r    make the wizards to be restart-able from the last page
/G[flags] specifies global flags and switches
w    suppress setup driver warnings UI (super quiet mode)

Examples:
Run server properties:
rundll32 printui.dll,PrintUIEntry /s /t1 /n\\machine
Run printer properties:
rundll32 printui.dll,PrintUIEntry /p /n\\machine\printer
Run add printer wizard localy:
rundll32 printui.dll,PrintUIEntry /il
Run add printer wizard on \\machine:
rundll32 printui.dll,PrintUIEntry /il /c\\machine
Run queue view:
rundll32 printui.dll,PrintUIEntry /o /n\\machine\printer
Run inf install:
rundll32 printui.dll,PrintUIEntry /if /b “Test Printer” /f %windir%\inf\ntprint.inf /r “lpt1:” /m “AGFA-AccuSet v52.3″
Run add printer wizard using inf:
rundll32 printui.dll,PrintUIEntry /ii /f %windir%\inf\ntprint.inf
Add per machine printer connection:
rundll32 printui.dll,PrintUIEntry /ga /c\\machine /n\\machine\printer /j”LanMan Print Services”
Delete per machine printer connection:
rundll32 printui.dll,PrintUIEntry /gd /c\\machine /n\\machine\printer
Enumerate per machine printer connections:
rundll32 printui.dll,PrintUIEntry /ge /c\\machine
Add printer driver using inf:
rundll32 printui.dll,PrintUIEntry /ia /c\\machine /m “AGFA-AccuSet v52.3″ /h “Intel” /v “Windows 2000 or XP” /f %windir%\inf\ntprint.inf
Add printer driver using inf:
rundll32 printui.dll,PrintUIEntry /ia /K /c\\machine /m “AGFA-AccuSet v52.3″ /h “Windows NT x86″ /v 3
Remove printer driver:
rundll32 printui.dll,PrintUIEntry /dd /c\\machine /m “AGFA-AccuSet v52.3″ /h “Intel” /v “Windows 2000 or XP”
Remove printer driver:
rundll32 printui.dll,PrintUIEntry /dd /K /c\\machine /m “AGFA-AccuSet v52.3″ /h “Windows NT x86″ /v 3
Set printer as default:
rundll32 printui.dll,PrintUIEntry /y /n “printer”
Set printer comment:
rundll32 printui.dll,PrintUIEntry /Xs /n “printer” comment “My Cool Printer”
Get printer settings:
rundll32 printui.dll,PrintUIEntry /Xg /n “printer”
Get printer settings saving results in a file:
rundll32 printui.dll,PrintUIEntry /f “results.txt” /Xg /n “printer”
Set printer settings command usage:
rundll32 printui.dll,PrintUIEntry /Xs /n “printer” ?
Store all printer settings into a file:
rundll32 printui.dll,PrintUIEntry /Ss /n “printer” /a “file.dat”
Restore all printer settings from a file:
rundll32 printui.dll,PrintUIEntry /Sr /n “printer” /a “file.dat”
Store printer information on level 2 into a file :
rundll32 printui.dll,PrintUIEntry /Ss /n “printer” /a “file.dat” 2
Restore  from a file printer security descriptor:
rundll32 printui.dll,PrintUIEntry /Sr /n “printer” /a “file.dat” s
Restore  from a file printer global devmode and printer data:
rundll32 printui.dll,PrintUIEntry /Sr /n “printer” /a “file.dat” g d
Restore  from a file minimum settings and resolve port name:
rundll32 printui.dll,PrintUIEntry /Sr /n “printer” /a “file.dat” m p

« Previous Entries