-
Posts
964 -
Joined
-
Last visited
Content Type
Forums
News
20th
EduGeek EDIT Conference
Blogs
Everything posted by LeightonJames
-
Remote Install of Printers using Powershell
LeightonJames replied to LeightonJames's topic in Scripts
I agree, unfortunately the powers that be don't want us to install print servers on site as we have over 50 locations to look after, and they fear we would be forever restarting spooler services on the servers. -
[pics] 007: Bond And M Face Swap [Done Well]
LeightonJames replied to 6Foot2's topic in Jokes/Interweb Things
Aggghhh, my eyes!!! -
Heard this on the way in to work this morning. Sad news indeed.
-
Remote Install of Printers using Powershell
LeightonJames replied to LeightonJames's topic in Scripts
Sorry for the delayed response. We don't run print servers on the network. All the printers are installed using TCP/IP ports only. If I can get this script to work I can then add it to GP and install the printers automatically. -
Hi All Powershell Noob here but I need to understand why this script fails when running against remote machines. (IP is a placeholder obv.) #################################################### # Change these values to the appropriate values in your environment $PrinterIP = "10.10.10.10" $PrinterPort = "9100" $PrinterPortName = "IP_" + $PrinterIP $DriverName = "Xerox WorkCentre 7855 PCL6" $DriverPath = "C:\Temp\Photocopier" $DriverInf = "C:\Temp\Photocopier\x2DSPYX.inf" $PrinterCaption = "Colour Photocopier" #################################################### ### ComputerList Option 1 ### # $ComputerList = $env:COMPUTERNAME ### ComputerList Option 2 ### $ComputerList = @() Import-Csv “C:\Temp\ComputersThatNeedPrinters.csv” | ` % {$ComputerList += $_.Computer} Function CreatePrinterPort { param ($PrinterIP, $PrinterPort, $PrinterPortName, $ComputerName) $wmi = [wmiclass]”\\$ComputerName\root\cimv2:win32_tcpipPrinterPort” $wmi.psbase.scope.options.enablePrivileges = $true $Port = $wmi.createInstance() $Port.name = $PrinterPortName $Port.hostAddress = $PrinterIP $Port.portNumber = $PrinterPort $Port.SNMPEnabled = $false $Port.Protocol = 1 $Port.put() } Function InstallPrinterDriver { Param ($DriverName, $DriverPath, $DriverInf, $ComputerName) $wmi = [wmiclass]”\\$ComputerName\Root\cimv2:Win32_PrinterDriver” $wmi.psbase.scope.options.enablePrivileges = $true $wmi.psbase.Scope.Options.Impersonation = ` [system.Management.ImpersonationLevel]::Impersonate $Driver = $wmi.CreateInstance() $Driver.Name = $DriverName $Driver.DriverPath = $DriverPath $Driver.InfName = $DriverInf $wmi.AddPrinterDriver($Driver) $wmi.Put() } Function CreatePrinter { param ($PrinterCaption, $PrinterPortName, $DriverName, $ComputerName) $wmi = ([WMIClass]”\\$ComputerName\Root\cimv2:Win32_Printer”) $Printer = $wmi.CreateInstance() $Printer.Caption = $PrinterCaption $Printer.DriverName = $DriverName $Printer.PortName = $PrinterPortName $Printer.DeviceID = $PrinterCaption $Printer.Put() } foreach ($computer in $ComputerList) { CreatePrinterPort -PrinterIP $PrinterIP -PrinterPort $PrinterPort ` -PrinterPortName $PrinterPortName -ComputerName $computer InstallPrinterDriver -DriverName $DriverName -DriverPath ` $DriverPath -DriverInf $DriverInf -ComputerName $computer CreatePrinter -PrinterPortName $PrinterPortName -DriverName ` $DriverName -PrinterCaption $PrinterCaption -ComputerName $computer } #################################################### If I run this against a single machine (uncommmenting # $ComputerList = $env:COMPUTERNAME) it works fine. No drama and everything is hunky dory. If I run it against a list of remote machines using the settings above then I get this error: Exception calling "Put" with "0" argument(s): "Generic failure " At D:\GPInstall\Printer_Install_Scripts\ColourPhotocopier\ColourPhotocopier.ps1:56 char:1 + $Printer.Put() + ~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ( [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException This happens everytime Has anyone got a working Powershell script that accomplishes this task or knows how to get this working? I have even put the relevant files into a network share and tried running it from there (changing file paths accordingly obviously). Cheers
-
[video] 118GB Floppy Disk (plus 1995 Skylake IBM Aptiva PC Mod)
LeightonJames replied to Arthur's topic in Jokes/Interweb Things
Probably one of the best mods I have seen in a long time. That Floppy enclosure gives me an idea for a USB floppy drive I have lying around...... -
Cheers @Arthur!!
-
Does anyone have the zipfile for rEFInd? I can't download it for some bizarre reason and it's doing my head in. Thanks in advance
-
Got my musical on the other night and watched Moulin Rouge again. It's the only musical I can watch. Really enjoy the film whereas my missus hates it lol
-
[website] Make the Censors Watch 'Paint Drying'
LeightonJames replied to unixman_again's topic in Jokes/Interweb Things
Not sure I can get over another wall drying if I'm honest. -
[website] Make the Censors Watch 'Paint Drying'
LeightonJames replied to unixman_again's topic in Jokes/Interweb Things
I think I will just Gloss over this announcement -
BURN IT! Sounds absolutely wrecked to me. Recover the data but then trash the machine. Not worth messing with.
-
Someone is in some MAJOR trouble for this one. Lincolnshire County Council hit by £1m malware demand - BBC News
-
[website] Make the Censors Watch 'Paint Drying'
LeightonJames replied to unixman_again's topic in Jokes/Interweb Things
You have it wrong, with that drivel he is clearly SLT. -
Let's hope they all get them with the faulty power cords before they get recalled!!! Here's Hoping
-
[website] Organic Vegan Quad Copter Drone for sale on ebay
LeightonJames replied to unixman_again's topic in Jokes/Interweb Things
Shut up and take my money!!! -
@kearton, visit the site on a laptop or computer and then with your smartphone visit the url it displays.
-
You could give rEFIT a shot. rEFIt - An EFI Boot Menu and Toolkit Does something very similar to BootPicker. Screenshot of Boot Menu:
-
A quick google found this method of doing it - How to Enable or Disable Tablet Mode in Windows 10 Longshot but they may have done it this way.
-
Can you imagine the call to the fire brigade if you need cutting out of one of these??
-
I escaped in 3:23!!
-
Yeah, because nothing puts your mind at ease during an earthquake like being buried alive in a metal box!!! O.o
-
That is AMAZING!!!
-
I assume these are gone now?? If not what MoBo is in them?
