Category: Powershell
Found some c# code drawing a Mandelbrot fractal (I’am so sorry I cant remember where or who) and thought that would be fun to do in powershell. Ended up doing a little animation of the fractal. All done in ASCII. This will not work if you r…
Read more →
Powershell 2 does not have a convertfrom-json function and I like to use json files for storing configuration. Searching the web gives almost zero results. Converting a multilevel json structure to hashtable would be very complicated. Since…
Read more →
Now that we have a database containing user, tenant and license it would be nice to have a function/command to list this. Took me a while to figure it out but thanks to Bing, I prefer Bing before google. I sync my database on a schedule onc…
Read more →
Ok, Now that we have syncronized our customers licenes to a local DB, we have this new commandlet to list them. This is a easy one, no advanced tokens setup to connect to Microsoft endpoint, only local database. function get-tenantlics { <#…
Read more →
This is a followup from previus post. In this post I will populate the database with what licenses a tenant has aquired. This will add records of what aquired skus and ‘usage’. For me this is how many license are bought versus how many are …
Read more →
Now that we have our tenants listed in a database table, listing them is quite easy. Added a switch that allow you to also list deleted/removed tenants. function get-tenantlistindb { param( [switch]$all ) $SQLInstance = "localhost\SQLExpres…
Read more →
Hi, I like to keep control of how many licenses our cutomers use versus how many have been purchased. Here is 1st part my PS script to copy the info from csp to the DB. I will start creating a database and table to keep a list of all the te…
Read more →
Resonse from webrequests are normally in Json format and converting back and forth is no problem using convertto/from-json. Only this time some computers did run Powershell 2.0 and did not have any “new” .NET framework installed. So I ran t…
Read more →
We all have the need to store data in some kind of arrays. I use hashtables a lot. Preferred use is as a lookup table, I can use ‘contains’ instead of looping through each item or reference an object by name instead of index number. Lookup …
Read more →
With the new powershell module SecretsManagement it is possible to add plugins. The new module is used to get/add/remove credentials. I created a plugin for secretserver to this module. To get started you will have to install secretsmanagem…
Read more →
When using using my secret server powershell functions I got tired of constantly searching for secret ID’s. I had to do a new search just because I could not remember the ID’s. So I added some kind of MRU to my get-secretID function. This c…
Read more →
Since we are using SecretServer as our credential store it is of great help to be able to get credentials directly from powershell. This is a small function that connects to secretserver webservices and retrieve a secret based on secred ID.…
Read more →
This is a small script that connects to partnercenter list all customers tenants and let you select one. When one is selected it connects to azuread and az for that customer. All my credentials are stored in SecretServer . I use a web servi…
Read more →
How can you get your external IP address from powershell? I use a simple script to query an external public web service. The service I’m using is hosted by ipinfo.io . I have created a small function that is placed in my powershell library.…
Read more →
In this part 3 of CSP and powershell I will show how you can connect to azureAD of a customer tenant using your CSP app credentials and refreshtoken. This is almost the same procedure as we use to connect to az. We will start with the same …
Read more →
In part 1 we created the Azure Enterprise App for Partnercenter and used this information to connect using powershell and connect-partnercenter. Now we will use this to connect to one of our customers tenants. First we will use AZ module an…
Read more →
A short explanation of how to access customer tenant using a CSP tenant SPN credential connectiong to AzureAD and AZ. Have been struggling for a while to manage all our customers tenants using powershell scripts. It can be complicated to or…
Read more →
Simple list of all mailboxes and rules. Displays more info if one of them contains a forwarding rule: $mb=Get-Mailbox | Sort-Object -Property displayname $t2=0;$t=($mb).count;$mb| ForEach-Object {write-host $t2"\"$t " " $_.displayname;$t2++…
Read more →
Was installing a Skype for Business server the other day, and the simple task of preparing the forest failed. I am always on the alert when doing Active Directory forest wide tasks as prepare schema and prepare forest, so it is not fun to s…
Read more →
One common question from users are “How can I forward my email to my home mail?” or from a manager “How can we forward his/her mail to the external address?”. In fact in Exchange there is several possibilities, but most of them requires som…
Read more →
IMAP was enabled on the Exchange server and had been used for a long time. One day the Exchange server’s IP subnet was placed in a Active Directory site without any Domain Controllers. Of course Exchange the services stopped running after a…
Read more →