Delete Printer Instances



Hi
I'd written a program to delete all the printer instances on a Win2K
server. I always encounter the "OLE IDespatch exception code 0 from
SWbemObject. Provider is not capable of the attempted operations" during
executing this line of code "objPrinter.Delete_ " . Full program as below.
No problem at all if this program is run on WinXP. I'd tried to restart the
WMI service but the error still persists. Indeed, any extra codes needed
under Win2K Server ? Tks a lot.

objLocator = CREATEOBJECT("WBEMScripting.SWBEMLocator")
objService = objLocator.ConnectServer
objService.Security_.ImpersonationLevel=3
objcolInstalledPrinters = objService.ExecQuery("SELECT * FROM
Win32_Printer")
FOR EACH objPrinter IN objcolInstalledPrinters
objPrinter.Delete_
ENDFOR


.



Relevant Pages

  • Re: NT Server - 98 WkStn Highschool Lab - Help!
    ... NT Server - 98 WkStn Highschool Lab - Help! ... Now they are at Win2k. ... you will have no luck using Windows 98. ...
    (Focus-Microsoft)
  • Re: SBS2003 + tombstoned WIN2K DC
    ... Last replication recieved from WIN2K at 2006-10-22 ... First you'll need to demote the 2nd DC (NOT the SBS server), ... computer shows up in the SBS server. ... I'm worried that if I remove the AD from WIN2K then everything will ...
    (microsoft.public.windows.server.sbs)
  • Re: e-mail
    ... Select the ones you want to allow, in your list imap server and pop3 ... For example lets say that your user name on your Suse is 'fred'. ... I will tell you all about procmail and fetchmail after lunch. ... on server rather than my win2k box which dual boots into opensuse10.2. ...
    (alt.os.linux.suse)
  • Re: DNS Problems adding Win2K3 Server to Existing Win2K Domain
    ... As I have understand, there are only one win2k server plays the DC, file ... The win2k server is called Dharma, DNS name is Dharma.org, it is also the ... Do you mean you have installed the DNS on win2k3 server? ...
    (microsoft.public.windows.server.migration)
  • Re: SBS2003 + tombstoned WIN2K DC
    ... Last replication recieved from WIN2K at 2006-10-22 ... First you'll need to demote the 2nd DC (NOT the SBS server), ... I'm worried that if I remove the AD from WIN2K then everything will ...
    (microsoft.public.windows.server.sbs)

Loading