Skip to content

Instantly share code, notes, and snippets.

zaab_it mrik23

Block or report user

Report or block mrik23

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mrik23
mrik23 / AzureAD-ChangeSettingsUnifiedGroup.ps1
Last active May 26, 2017
PowerShell script to change Azure AD Directory Settings so basic users are not able to create Office 365 Groups AKA Unified Groups, a security group is added the right to create Office 365 Groups, and Guest users are blocked to join and access Office 365 Groups. This is a quick way to regain control on your tenant as an admin.
View AzureAD-ChangeSettingsUnifiedGroup.ps1
<#
Description:
This script modifies the existing Azure AD Directory Setting for Unified Groups with the objective to block users to create Office 365 Groups, and only allow users member of a dedicated security group.
Also it blocks external users to be added to Office 365 Groups (it's possible to by-pass this in applying a different setting to specific groups) and access Office 365 Groups.
It's recommended to run this script step by step PowerShell ISE. You can modify the settings or add others as you need.
Prerequisites:
- Install Azure Active Directory V2 PowerShell Module - Public Preview Release 2.0.0.114 from https://www.powershellgallery.com/packages/AzureADPreview/2.0.0.114
- Create a security group in your Azure AD tenant or local synced AD for users allowed to create Office 365 Groups
@mrik23
mrik23 / ActiveDirectory-BulkChangeAttributesWithFilteringOnUsers.ps1
Last active Jun 21, 2017
PowerShell script for Active Directory. In "one" line script we are able to retrieve users based on a specific attribute and update some attributes to them.
View ActiveDirectory-BulkChangeAttributesWithFilteringOnUsers.ps1
<#
This is an example on how to filter out users based on some standard filter and non-standard attribute.
In this case we pull all active users with the company Contoso, we force the attribute countryCode to be retrieved.
Then we select the users that have the countryCode empty and finally set the correct attributes for these users.
#>
$Users = Get-ADUser -Filter 'enabled -eq $true -and company -eq "Contoso"'`
-SearchBase "OU=Texas,DC=Contoso,DC=com"`
-Properties Department, Title, countryCode | `
where {$_.countryCode -eq ""} | `
@mrik23
mrik23 / basic.json
Created Jul 2, 2017
JSON example 01
View basic.json
{ "server":"DC001" }
View two_pairs.json
{
"server":"DC001",
"location":"Paris"
}
@mrik23
mrik23 / array.json
Last active Jul 2, 2017
JSON example 03
View array.json
{
"servers":[ "DC001", "ADFS001", "WAP001" ]
}
View objects_in_array.json
{
"servers":[
{
"server":"DC01",
"location":"Paris"
},
{
"server":"DC02",
"location":"London"
}
@mrik23
mrik23 / ps_json_cmdlets.ps1
Created Jul 2, 2017
PowerShell JSON Cmdlets
View ps_json_cmdlets.ps1
Get-Command *json*
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet ConvertFrom-Json 3.1.0.0 Microsoft.PowerShell.Utility
Cmdlet ConvertTo-Json 3.1.0.0 Microsoft.PowerShell.Utility
@mrik23
mrik23 / azuredeploy.json
Created Jul 2, 2017
Basic ARM Template
View azuredeploy.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [],
"outputs": {}
}
@mrik23
mrik23 / arm_syntax.json
Created Jul 2, 2017
ARM Template syntax
View arm_syntax.json
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "",
"parameters": {
"<parameter-name>" : {
"type" : "<type-of-parameter-value>",
"defaultValue": "<default-value-of-parameter>",
"allowedValues": [ "<array-of-allowed-values>" ],
"minValue": <minimum-value-for-int>,
"maxValue": <maximum-value-for-int>,
@mrik23
mrik23 / arm_template_with_functions.json
Last active Jul 2, 2017
Example ARM Template with functions
View arm_template_with_functions.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"apiVersion": "2016-01-01",
"type": "Microsoft.Storage/storageAccounts",
"name": "[concat('storage', copyIndex(), uniqueString(resourceGroup().id))]",
"location": "[resourceGroup().location]",
"sku": {
You can’t perform that action at this time.