Zum Inhalt

Kategorie: Business

Powershell – Script automation with jobs (AD Quota)

After working a while with Powershell and doing some time expensive jobs like getting the quota of all Microsoft servers I came to the point when i was looking for some parallelisation in Powershell. My problem was the quota script, that executes the following command for each file server:

Actually we have a couple of servers and need to get the quota from all servers to calculate the file system usage and built a daily statistic. The first script collected the data from each server. Since this is a boring job, because reading a file stream and writing it to a local file is really boring, even for a computer. I wanted to accelerate this step. So i got in touch with Powershell and jobs. Jobs are (dont kill me) distantly related with multithreading in .NET. Indeed, multithreading in .NET has many more advantages and features than in powershell, but as a beginner (some years ago 🙂 ) in development i didn’t do anything more than just starting threads and wait until they are finished (Yep, invokation was a foreign concept to me). So this relation is not so far out. Anyway, jobs do a great job if you…

Weiterlesen Powershell – Script automation with jobs (AD Quota)

Powershell – Rename domain computer remotely (within an active directory domain as well)

I wanted to rename a couple of computers within our active directory. After some research i figured out thats it seems to be nearly impossible to rename a computer by just touching one object: the ad computer object, or the computer (client) itself. My first thought was „ok, you have to rename both objects, rejoin the computer and hope everything works“. But that’s no solution, that makes me happy, because the more steps you do, the more problems can occure. For examples, what happens if the computer has to reboot, after renaming to get correct rejoined? Do i have to create a local admin account at the clientside to have permissions after the computer lost his connection to ad? And so on… I played around, renamed the ad object, rebooted it – negative, the computer has to be joined again. After that i tried it the „bottom up“ way by renaming the computer by hand, and rebooted it instantly. While the computer was shutting down i noticed, that the computerobject in active directory was renamed before the computer was finished with its shutdown process. So i tried this several times and every time the ad computerobject was renamed properly. YAY!…

Weiterlesen Powershell – Rename domain computer remotely (within an active directory domain as well)

Powershell – SCCM – Readvertise a previously installed softwarepackage remotly (not from console)

Ever came to the situation, that you have to rerun an advertisement on a computer after a failed installation with SCCM? This could happen if you want to install flashplayer or adobe acrobat or some kind of software that is frequently used by the user. We had problems on installing software while wsus was installing its updates and the msi installer said „Hmm… perhaps, another installation is running already, so I cant do anything for you (BLAME!), sorry“. I hate this message, because its a pain in the ass to readvertise these failed softwarepackages on a single computer. As some posts earlier mentioned, I am writing an administration webapplication to administrate our environment. This includes softwaredeployment too. We address our softwarepackages by Active Directory groups. Every time we create a new softwarepackage, we create a seperate computer collection in SCCM and link it to a newly created ad group. Every member of this ad group (computers for instance) gets the linked software by SCCM. While it’s a bit difficult to get some automation into the readvertisement with all these groups and links, we wrote a script, that is triggered by my webgui and does this job on the client computer…

Weiterlesen Powershell – SCCM – Readvertise a previously installed softwarepackage remotly (not from console)

Active Directory – Supersonic and the directory searcher

Whats the difference between supersonic and the directory searcher? Nothing, because if you get over ~1000 you crash into a wall. 🙂 Last week we had to deal with the limitations on the directory searcher. We performed a user search on an organizational unit (subtree) with more than 1000 users beneath. We where astonished that our userobject only contained 1000 items every time we did the search. I wrote a little test script in powershell to reproduce this behaviour and to see if this limitation is a C# problem or not. So I wrote this script:

As expected, powershell returned only 1000 objects. Then we tried to find out why and looked at the $objSearcher property list.

As you can see, there are two interesting properties: sizelimit and pagesize. So I played around with these two properties and found some explanations for them. Sizelimit is the limit for the maximum returned results, but you can’t set this property above 1000. So I looked at the second property, pagesize. This property sets the maximum result items per returned page. So all you have to do is, set sizelimit to 0 and set pagesize to 1000 and you will get…

Weiterlesen Active Directory – Supersonic and the directory searcher

Windows XP – Offer Remote Desktop Assistance with predefined ip

If you want to automate the remote desktop assistance (not remote desktop) with Windows XP you run into some problems. First of all I ran into the problem that „rcimlby.exe“, which seems to be a good point to start lacks with its commandline parameter. I thought that „rcimlby.exe“ has a hidden parameter to submit a computer netbios name, or a ipaddress to connect directly to the computer after launching the application, but after debugging the exe I didn’t find any indication for a computerobject parameter, so I started to look elsewhere and found a pretty simple solution.

As it turns out, rcimlby.exe calls a help website (Windows XP help) from where you can start a remote desktop assistance. But this website hasn’t a parameter for the computerobject as well and it seems to be impossible to call this website within the help explorer, so I traced the way rcimlby.exe calls this website and found this call:

But there is no way to add a parameter for the computerobject, so I started to find out where these weird (and never used 😀 ) html helpfiles are stored (especially where UnSolicitedRCUI.htm is stored)
Weiterlesen Windows XP – Offer Remote Desktop Assistance with predefined ip

SCCM – SQL Query for Computer Information (statistics)

I am developing an administrative webgui to give our admins access to different services to manage their users and computers in our new Active Directory environment. We came across that this is the best solution to automate so many things like creating home folder, creating profile folder, creating terminalserver profile folder, set ACL to folders, create and publish printers to the AD, set quota for different kind of folders, distribute software via SCCM by AD groups and so on. It is necessary that every admin can only see objects that belong to his department. After developing all these base functionality we came to the conclusion that the information that is stored in the SCCM database is really informative for the admins, so we created some selects for the database to get the information about computerobjects, softwarestatus, hardwareinformation, etc…

Additional we thought it would be a great idea to build some kind of dashboard to get an overview over our environment and whats going on there, so we played around with the SQL Adminstudio and got some good looking SQL queries, implemented these and display the information in some pie charts (highcharts.com).
Weiterlesen SCCM – SQL Query for Computer Information (statistics)

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]

phpHatesMe

Der Blog eines guten Freundes, zu finden unter http://www.phphatesme.com/ ist für jeden PHP Entwickler pflicht! Mit viel Elan und vielen Ideen schneidet Nils Langner und co. diverse PHP Themen an. Besonders beeindruckend ist, dass es täglich einen neuen Beitrag gibt und das, so finde ich sollte an dieser Stelle auf mal gelobt sein!! Viel Erfolg weiterhin

Weiterlesen phpHatesMe

McAfee Orchestrator Migration ohne Active Directory – Update 2

Wie Migriert man einen Epolicy Orchestrator 3 Schritt für Schritt auf einen Epolicy Orchestrator 4 ohne Active Directory.

How to Migrate Epo 3.x to Epo 4.x step by step without AD (active directory)
( Need this in English? Mail me -> marcodifeo [AT] gmx.de)

Wer von dem Produkt McAfee Epolicy Orchestrator auf eine neue Version migrieren will hat mehrere Möglichkeiten dies zu bewältigen.
Am einfachsten geht es mit einem Microsoft Active Directory um die vorhandenen Clients Schritt für Schritt umzuziehen. Hat man keine AD zur Hand so ist eine Schritt für Schritt Migration scheinbar nicht möglich.

Weiterlesen McAfee Orchestrator Migration ohne Active Directory – Update 2

Adobe PDF – Firefox – Dict Objekt wurde erwartet (Solution)

Quizbar Präsentation Nach einigen Meldungen, dass Firefox beim aufrufen von PDF Dateien Probleme verursacht bin ich dem Problem auf den Grund gegangen.
Beim aufruf mancher PDF Dateien kommt die Meldung „dict objekt wurde erwartet“ (eng: „Expected a Dict Object“). Google brachte nur Informationen über Einstellungen im Acrobat Reader. Hier sollte man unter Einstellungen -> Internet sämtliche häckchen entfernen.
Dies brachte bei mir aber keine Abhilfe.
Weiterlesen Adobe PDF – Firefox – Dict Objekt wurde erwartet (Solution)