struttshumming
-
Total Posts
:
8
- Scores: 0
-
Reward points
:
0
- Joined: 3/14/2008
-
Status: offline
|
PRNADMIN & powershell
Thursday, October 09, 2008 5:50 AM
( permalink)
Hi there, I am tring to use PRNADMIN to create a printer and port on a print server. However I cannot seem to invoke the ADD method. can any please piont out where i am going wrong? Here is the code: $MAS = New-Object -ComObject PrintMaster.PrintMaster.1 $POR = New-Object -ComObject Port.Port.1 $PTR = New-Object -ComObject Printer.Printer.1 $POR.ServerName = "MyPrintServer" $POR.PortName = "MyPortName" $POR.HostAddress = "MyAddress" $POR.PortType = 2 $POR.QueueName = "Binary_P1" $MAS.? #Need to invode add method her to create port $PTR.ServerName = "MyPrintServer" $PTR.PrinterName = "MyPortName" $PTR.DriverName = "HP4 laserjet" $PTR.PortName = "MyPortName" $MAS.? #Need to invode add method her to create printer $MAS.PrinterGet($strPrintServer, $printerName, $PTR) $PTR.Comment = "Windows LPR Port" $PTR.Location = "MyLocation" $MAS.? #well you know what i mean
|
|
|
|
dm_4ever
-
Total Posts
:
3687
- Scores: 82
-
Reward points
:
0
- Joined: 6/29/2006
- Location: Orange County, California
-
Status: offline
|
RE: PRNADMIN & powershell
Friday, October 10, 2008 2:24 AM
( permalink)
Did you try.... $MAS.PortAdd($POR) this worked for me so if it is not working for you then something else may be wrong.
|
|
|
|
struttshumming
-
Total Posts
:
8
- Scores: 0
-
Reward points
:
0
- Joined: 3/14/2008
-
Status: offline
|
RE: PRNADMIN & powershell
Sunday, October 12, 2008 7:48 PM
( permalink)
cool, works fine. thing i need a new IDE with better telesence.
|
|
|
|