Automate Signature And Status Reports With PowerShell – Windows Defender (.txt file)

What you will be able to after reading this blog: Get the latest information about "your" Signature- & Anti Virus reports in Windows Defender and make it into a text file. How to automate it, so it will run every day and give you a status report with time and date. Being able to look at what time and date the latest updates have been completed. First of all, we have to create a folder/directory where the status reports can be stored in. Open up PowerShell in administrative mode and run this script only by copy-paste: [crayon-5a91f610599f0641053459/] Now that the [...]

PowerShell Script That Creates A Folder And A Shortcut On Your Desktop

Basic example of a script that creates a folder in your Local Disk "C"  and then makes a shortcut on desktop so you have easy access to the folder. First of all, open your powershell as administrator and make sure you are at a place where you are able to create folders such as the C:\ drive. PS C:\WINDOWS\system32> cd .. PS C:\WINDOWS> cd .. PS C:\> And now you are able to run the script! - Copy and paste what is written below [crayon-5a91f6105b07e936133672/] Now that we have tried to create one folder, why not try to create 2 [...]

Azure Automation DSC: How to register and use Azure Automation DSC

One of the new features of Azure Automation is still somewhat hidden. It needs to be enabled before you see it in the GUI This blog post gives a quick overview of what is needed to use it.   Step 1: Enable the extension in your Azure Account [crayon-5a91f6105b629537530704/] The command registers the azure automation dsv extension on your account. This shows the DSC Nodes tile in your automation account:     Step 2: Select subscription and default values Before you can run any command you will need to select your subscription. additionally each of the command needs 2 values [...]

PowerShell: LEAP Motion PowerShell Lottery Script @ Danish PowerShell User Group

In our geek club aka The Danish PowerShell user group, we always do a lottery in the end, for books or similar. To draw the correct winner we have been using a script that I have developed. I have for a long time, promised to release the script so that other user groups or other interested people can use it for fun! It has amazing ascii graphics and colors!!! It will take you straight back to your C64 loading screen! The script is a lottery script that takes a file from www.eventbrite.com containing all attendees. The script need a LEAP [...]

Windows Server 2016 Technical Preview 2 ADFS New PowerShell cmdlets

Quick comparison shows that we have 37 new PowerShell cmdlets :) cmdlet name Add-AdfsLocalClaimsProviderTrust                                                                           Add-AdfsScopeDescription                                                                                   Add-AdfsTrustedFederationPartner                                                                           Disable-AdfsCertificateAuthority                                                                           Disable-AdfsLocalClaimsProviderTrust                                                                       Enable-AdfsLocalClaimsProviderTrust                                                                        Get-AdfsAccessControlPolicy                                                                                Get-AdfsApplicationPermission                                                                              Get-AdfsAzureMfaConfigured                                                                                 Get-AdfsCertificateAuthority                                                                               Get-AdfsLocalClaimsProviderTrust                                                                           Get-AdfsRelyingPartyWebTheme                                                                               Get-AdfsScopeDescription                                                                                   Get-AdfsTrustedFederationPartner                                                                           Grant-AdfsApplicationPermission                                                                            Invoke-AdfsFarmBehaviorLevelRaise                                                                          New-AdfsAccessControlPolicy                                                                                New-AdfsAzureMfaTenantCertificate                                                                          New-AdfsLdapAttributeToClaimMapping                                                                        New-AdfsLdapServerConnection                                                                               Remove-AdfsAccessControlPolicy                                                                             Remove-AdfsLocalClaimsProviderTrust                                                                        Remove-AdfsRelyingPartyWebTheme                                                                            Remove-AdfsScopeDescription                                                                                Remove-AdfsTrustedFederationPartner                                                                        Restore-AdfsFarmBehaviorLevel                                                                              Revoke-AdfsApplicationPermission                                                                           Set-AdfsAccessControlPolicy                                                                                Set-AdfsApplicationPermission                                                                              Set-AdfsAzureMfaTenant                                                                                     Set-AdfsCertificateAuthority                                                                               Set-AdfsLocalClaimsProviderTrust                                                                           Set-AdfsRelyingPartyWebTheme                                                                               Set-AdfsScopeDescription                                                                                   Set-AdfsTrustedFederationPartner                                                                           Test-AdfsFarmBehaviorLevelRaise                                                                            Test-AdfsFarmBehaviorLevelRestore   Best

By | 2017-08-22T10:22:02+00:00 May 13th, 2015|Powershell, Windows Server|0 Comments

Beyond unsupported – How to add PowerShell ISE to ConfigMgr Admin Console

As you already know, then currently we can only start PowerShell Console through Configuration Manager Admin Console but most likely  you may want to start PowerShell ISE through Admin Console :) Step-by-step guide First, this is not supported so don’t blame me if something is not working. Please also remember that there is no SAVE button in Admin Console Builder Tool! Close ConfigMgr Admin Console Start AdminUI.ConsoleBuilder.exe – You can find this tool under the Admin Console installation folder   Select File –> Open –> ConnectedConsole Select View->Application Menu Items Select Connect via Windows PowerShell and right-click select Clone Now [...]

Working with Queries in ConfigMgr with PowerShell

I accidentally blew up my dev lab and now I need to build a new one but luckily we have PowerShell :). In this picture we have 8 Queries and I would like to create Device Collections based on these Queries. These Queries are built with Servicing Extension.   Here are some of the commands that we can use in Configuration Manager 2012 R2 CU4. These commands allows us easily export/import Queries from one system to another and much more. [crayon-5a91f6105cecb925341623/] Little bit later we have nice Device Collections in System folder   Using the PowerShell GridView output we can [...]

New ConfigMgr PowerShell cmdlets in CU4

Microsoft just released a new CU for Configuration Manager and with latest CU we got 35 PowerShell cmdlets. Now we have 597 PowerShell cmdlets. Here are the new ones: Add-CMDeploymentTypeDependency Add-CMDeploymentTypeSupersedence ConvertFrom-CMApplication ConvertFrom-CMConfigurationItem ConvertTo-CMApplication ConvertTo-CMConfigurationItem Get-CMCertificate Get-CMClientOperation Get-CMDeploymentTypeDependency Get-CMDeploymentTypeDependencyGroup Get-CMDeploymentTypeSupersedence Get-CMMigrationSource Get-CMObjectSecurityScope Get-CMQuery Get-CMSiteRole Invoke-CMGroupDiscovery Invoke-CMQuery Invoke-CMSystemDiscovery Invoke-CMUserDiscovery New-CMADGroupDiscoveryScope New-CMDeploymentTypeDependencyGroup New-CMEmbeddedObjectInstance New-CMEmbeddedProperty New-CMEmbeddedPropertyList New-CMQuery Remove-CMCollection Remove-CMDeploymentTypeDependency Remove-CMDeploymentTypeDependencyGroup Remove-CMDeploymentTypeSupersedence Remove-CMQuery Set-CMDeploymentTypeDependency Set-CMDeploymentTypeDependencyGroup Set-CMDeploymentTypeSupersedence Set-CMQuery Sync-CMMigrationSource   Happy Scripting! :)

Create ConfigMgr Collections and Admin Console Folders with PowerShell

Starting from ConfigMgr 2012 R2 we can use New-Item PowerShell cmdlet to create ConfigMgr Admin Console folders. Here is one simple and quick PowerShell script that allows you to create folders and Collections and finally it moves the Collection to correct folder. [crayon-5a91f6105e11f236332819/]   After the script execution you have 6 folders and in each folder Test x Collection – as you see it is really easy to create Collections and Folders with PowerShell.   Best, Kaido

Service Manager powershell snippets

Merry x-mas! In today’s December calendar tips & trick I'm going to a post some useful powershell snippets for Service Manager. As we all know, the December 11th is the special day where the Bethlehem-powershell star outshined all the others.        The scripts here is mostly for administrative purposes. They are of course provided “as-is” so feel free to expand/optimize/ include more error handling etc. Create Management Pack UPDATE: Script now works with different windows localization. Default language will now be set according to the console language user preference and not the windows locale Unfortunately we are not [...]

By | 2014-12-11T09:36:00+00:00 December 11th, 2014|Powershell, Service Manager (SCSM)|0 Comments

Get Direct Collection Memberships And Machine Variables Information

On several occasions I have had the need to pull information on SCCM devices, and recently I was asked to do a backup of all client direct memberships and some specific machine variables. So I thought I would share my latest version of a script that does that. The script takes an argument that will allow you to limit the process to only a set of named clients or just one if you prefer. [crayon-5a91f610618b0412309995/] The script starts by create a class to contain the information pulled from SCCM, making it easier to work with afterwards. [crayon-5a91f610618ba134251150/] Next the script [...]

How to populate object properties with data from a database using PowerShell

  You probably know how you can use a registry discovery to populate properties on windows computer instances, but what if you already have the data in SQL database/CMDB and want to avoid having to first write the data to the registry and then use a discovery to get the data into SCOM? Or what if the objects are not windows computers and hence the registry method is not an option? The solution is to use PowerShell to read  the data from the database and then update the objects in SCOM. This post will show you how to do this [...]

By | 2014-12-09T04:09:00+00:00 December 9th, 2014|Operations Manager (SCOM), Powershell|0 Comments

Change device ownership in Configuration Manager with PowerShell

All newly enrolled devices are enrolled as Personal Devices by default in Configuration Manager and we cant change the default behavior. If the Device Ownership is Company, then we can inventory all the installed applications and we can also do mandatory installations. If the Device Ownership is Personal, then we can inventory only applications that are installed through Company Portal. If your company policy is that all the devices must be company-owned, then you can use this script to query a specific collection devices and it will set the Device Ownership to Company. [crayon-5a91f610623dd108245261/]

Configuration Manager 2012 SP1 and R2 PowerShell Provider

Updated 23.03.2015! As you might have already noticed that Configuration Manager PowerShell Provider is lot like Active Directory, Registry etc. provider. To run a cmdlet you need to be inside CMSITE. If you are still using SP1+, then: 1. you can´t use New-Item cmdlet to create folders 2. you can´t set the location to sub folders 3. Get-ChildItem does not work at all If you are using R2+, then 1. You can use New-Item to create folders 2. You can change the location i.e. sub folders etc. 3. Get-ChildItem only prints out folder objects but not collections, applications etc. inside [...]

PowerShell Deployment Toolkit: Windows Azure Pack install fails

I am a big fan of PDT but I have been trying to install Windows Azure Pack and the complete system center using PowerShell Deployment Toolkit Using the newest version (currently version 2.64.2611) it fails installing the Windows Azure Pack components! Luckily i found the error: Use a password for the installer user that follows the rules for Windows Azure Pack Minimum 8 chars Include at least one upper case letter and one lower case. include at least one number Include at least one non-alphanumeric. (In my case i was missing this! .. so added a ! to the password) [...]

By | 2014-09-23T14:16:47+00:00 September 23rd, 2014|Powershell, Windows Azure Pack (WAP)|2 Comments

Scripts and links from my sessions @IT/Dev connections

A big thanks to all who attended at our sessions. Below are the links to the scripts and blog post we referenced during the session. Hope to see you all again next year! Managing Configuration Manager with PowerShell  Building Custom Tools Using PowerShell  Truly Better Together: Configuration Manager 2012 R2 and PowerShell  Quick and Dirty – Build Configuration Manager 2012 Admin Console Extensions automatically - http://cm12sdk.net/?p=2299 Configuration Manager 2012 R2 Developer Excel Sheet - http://cm12sdk.net/?p=2326 Does Your Hard Work Advance the Ecosystem? - http://blogs.msdn.com/b/powershell/archive/2011/02/07/does-your-hard-work-advance-the-ecosystem.aspx Coretech Collections Tool - http://blog.ctglobalservices.com/kaj/coretech-configuration-manager-2012-r2-powershell-automation-module-0-1/ Before you start using these script examples on your production environment, please make [...]

Store encrypted password in a PowerShell script

I write a lot of PowerShell scripts where I need to access different kinds of services, servers and databases. Often these scripts needs to run on schedules in the background and so on. Instead of having cleartext passwords scattered throughout the scriptfile I like to store a securestring version of the password in the script. Normally you would build a credential object using something like this [crayon-5a91f6106285e021189478/] That means that anyone who can open and read the scriptfile, will know what the password for the account in question is. Which is VERY BAD. It would be better if we could [...]

By | 2017-09-07T22:55:56+00:00 September 10th, 2014|Powershell|16 Comments