Saturday, 10 June 2017

Static classes in Powershell

Static in PowerShell is calling a method without creating instance of the object.
In Powershell it not always mandatory to create new function, there are many existing .Net build function can be used.

Eg. [Math] class

PS C:\> [math]::Sqrt(4)

To see all the static method associated with the class

PS C:\> [math] | gm -Static

Happy Learning

Sunday, 19 March 2017

Powershell Script Security.

Sometime the script will not pass through the Compliance as you have hard coded the password information of account in the script and any one who have the access to the server can use it with GOD mode access, Many times to come out of the situation converted my scripts to exe and deployed it in Production, However there is a drawback know one cannot debug the scripts and about the functionality.What if you not there in the company anymore,It will be a nightmare to team who is managing it.

There is one way I am writing it here without converting the script to exe, however it is not a full proof security ,but to some extent you can hide the password information from the user.

Thanks ..

Saturday, 4 March 2017

.. Year 2017

# I do not have my resolution yet this year, may be I am in comfort Zone
   I have to kick my ass and start working.

This year we are going to see a lot of transformation, It's good for all IT guys start embracing cloud technology.

I set my Goals today.

Azure AD connect.
Learn C# Programming
Office 365

Thursday, 29 December 2016

Window Azure AD Connector : Group Membership.

Group membership of on-premise not sycing to Office 365.

Sometime the membership to the group on-premise will not match to the number of membership to the group in O365. There could be numerous reason the number will not match, are all the member to the group on-premise present in Azure AD ? 

If all the member to the group are present in Azure AD and still not member to the group in O365. check the membership of the group in  Azure AD and in EXO.

Determine the group member count in Azure AD

1.  Connect to MSOL (connect-msolservice)
2.  Run get-msolgroup -searchstring "GroupName" | foreach {(Get-MsolGroupMember -GroupObjectId $_.objectid.guid).count}

Determine the group member count in EXO

1. Connect to Exchange online shell
2. Run (Get-DistributionGroupMember "GroupName").count

  If the count is different, there is no option left with us to fix it,Raise a case with Microsoft and they will sync the group membership at backend. 

Happy New Year to All .

Sunday, 9 October 2016

FIM 2010 R2 to MIM 2016 InPlace Upgrade [ excluded service and portal ]

As most of our FIM infrastructure is in Server 2008 R2, It always a business decision whether we are doing in place upgrade or migrate it over to totally new Server 2012.

FIM 2010 R2 to MIM 2016 InPlace Upgrade [ excluded service and portal ]

1. Snapshot of VM
2. Back up of your database
3. .Net framework of 4 or higher is supported by MIM, if it is not there make sure it is upgraded to 4 or higher version.
4. Change the compatibility level of SQL to 100 using SQL Management Studio.
5. Backup the encryption key

 It is very important to back up the encryption key if you plan to use the existing database.  The reason for this is that the server configuration, extension DLLs and other vital information is stored in the database.  It will make life much easier in your migration upgrade.

6. Backup the extensions folder

 This is not absolutely necessary unless you plan to start with a clean database.  The extension DLLs are actually stored in the backend database as well as the extensions folder.  If you backed up the encryption key before moving or restoring the existing database from FIM, then these DLLs will be re-populated into the extensions folder.

 If for some reason you do not see the DLLs, then utilize your backup of the previous extensions folder to repopulate your Extensions.

7. Backup the source code.

Nowhere it is mentioned to uninstall the FIM , if you are doing a inplace upgrade you have to uninstall the FIM from Control Panel\All Control Panel Items\Programs and Features.

Once the FIM software uninstalled restart the server.

Navigate to the location of the Installation files for MIM 2016 Synchronization Service and begin the installation.

While installing point your SQL server instance to FIM Synchronization database of FIM and steps are same like FIM installation however the installer will discover the FIMSynchronization database and asked for the encryption key.After entering the Key it will start rebuilding your index and FIM will upgrade to MIM.

Please do test all your logic and upgradation in Test before moving to production.

All the Best..!!

Friday, 9 September 2016

FIM/ MIM Integration | ServiceNow MA

This article can be refer as reference only, how can you build your first Management Agent connect to Service Now.  The samples code show how to call the Service Now REST API from ECMA 2.0
The table for users is sys_user in Service Now or get the details of table from service now developer.

Service Now API exchange the information in form of JSON (Java Script Object Notation)

To parse JSON object in C#, use the Newtonsoft JSON library

The Code, please make your own adjustment according to your need, 

The password is not encrypted.

Configure Run Profile "Full Import" and run it.
In connector it will import all the users from service now table.

Thanks.. Best of LUCK.


Saturday, 13 August 2016

Asp.Net Web Service Application in Visual Studio 2015

It took some time to figure me out how to use the webservice in Visual Studio 2015, So blogging it here...


ASP.NET Web Service Application project template is not available for .Net framework 4.0, however, available for .Net Framework 3.5.

If you want to use ASMX, choose ASP.NET Empty Web application and then you can add ASMX files to the project.
Create a new project targeting the .NET Framework 3.5
Add New Item to the Project.
Now you can start writing your webservice

Thats all for today..!!


Born as Mathematician, Found love in Scripting and want to have an affair with C#

Total Pageviews