Zum Inhalt

Schlagwort: remove

Active Directory W2008 R2 – Remove DNS record with Powershell and WMI

The Simplest way of removing a DNS record from your active directory is using WMI. With Server 2008 R2 you can use powershell to get the record by setting a filter for the domainname and pipe the object to the wmiobject remove routine like this:

There are several online solutions available, but most of them use the wrong namespace and wrong filter parameter. This one workls perfectly. Ensure that you are using an administrative powershell with domainadmin privileges.

Weiterlesen Active Directory W2008 R2 – Remove DNS record with Powershell and WMI

SCCM – Delete computer object via powershell and wmi [edit]

After one hour of research i found a solution on how to delete a computer object in sccm from a remote computer via Powershell. First of all you need to get the computer object from your sccm namespace „ROOT\SMS\site_[yoursite] -> SMS_R_SYSTEM. All machine items are stored in SMS_R_SYSTEM, so i used a wmi query with a filter to get the object i need. There are several ways you can get the computer object, another example is a WMI query, that returns the object.

You should check if the $compObject is empty or not and if not you can just use psbase to delete the object from the sccm server completly (not only from the collection) by using this statement

  How to deal with multiple objects [edit] Special thanks to Leeni, who wrote a comment at this post on how to deal with multiple entries at your SCCM server. If your WMI query returns more than one object you have to handle this a bit different. To check if your query returned more than one object try this:

or

Both properties are only set if your result contains more than one object, so you can easily…

Weiterlesen SCCM – Delete computer object via powershell and wmi [edit]

JQuery dynamic event handler

I came to the conclusion that dynamic event handlers can make my life much more easier, so I can write more cleaner and maintainable code. My idea was to add different class names to an element to bind different event handlers to it. This way, I could get rid of some global variables and switch case loops that i needed to manage my functions. The second advantage is, that you can chain event handlers to do things one after another.

Here is a small example that adds classnames to a button and binds dynamic event handlers to the class attribute. Depending on the class attribute an event handler fires an alert box that indicates which classname was added to the button.

Weiterlesen JQuery dynamic event handler

McAfee Uninstaller v0.1

Ich habe ein kleines Programm geschrieben um den McAfee Agenten / Virusscan Enterprise auf dem System zu deinstallieren, oder die Epo GUID neu zu setzen. Je nach dem, ob McAfee Prozesse beendet werden dürfen wirft das Programm einen Hinweis, dass der Dienst vorher erst beendet werden muss, bevor die Deinstallation durchgeführt werden kann. Deinstalliert werden kann VSE 8.0, 8.5, 8.7 und 8.8, sowie der McAfee Agent. Über die Hilfe bekommt man die Kommandozeilenparameter Das ganze wurde in AutoIt entwickelt und mit SciTe kompiliert. Im Anhang findet ihr den Sourcecode. Was ihr noch benötigt sind die resourcefiles von hier: http://www.autoitscript.com/forum/topic/51103-resources-udf/ und separate Icons. Anbei das AU3 Script, sowie das Formfile für das Programm coda Hier die Form1.kxf und die mcafeeuninstall.au3

Weiterlesen McAfee Uninstaller v0.1