Tuesday, 20 September 2016

Installing .Net Framework 3.5 With out OS Image for Windows 2012 Server

Installing .Net Framework 3.5 With out OS Image :

We can easy do that through group policy editor,

Go to gpedit.msc -> Administrative Templates -> Systems -> "Specify settings for optional Component Installation and component repair" to Enabled and Checking the box " Contact Update directly to download repair content instead of windows server update Services (WSUS) "

Once the options, Go to Command prompt and do gpdate /force

Then I start the .Net Framework installation from windows service

Migrating the Azure VM From One region to another region

Migrating the Azure VM From One region to another region

Setps & Steps to migrate azure VM from one region to another region :

1. Download & Install the AzCopy Utility Tool
2. We can easily move the VM from One region to another region. First, we need to create one storage account in destination region either it should be Premium or Standard account.
3. Get the Source OS disk blob Url, the url should looks like
 https://test.blob.core.windows.net:8080/vhds/test-os-7171.vhd... Go through on azure portal ->https://portal.azure.com ->Storage accounts ->storage accounts name -> blob Service -> get the blog url with container name
4. Same way get the other disks as well
Once get all those Information
5. Open the AzCopy Utility tool and paste the below command

AzCopy /Source:<https://sourceaccount.blob.core.windows.net/mycontainer1>  /Dest:https:<//destaccount.blob.core.windows.net/mycontainer2>  /SourceKey:<key1>  /DestKey:<key2> /Pattern:<abc.txt>).

Command Description :
<key1> --- Manage keys of Source Storage
<key2> ---- Manage keys of Designation Storage
<abc.txt> ---  test-os-7171.vhd (Path of C Drive)

Then copying transfer may start!!!! Do it all the disks

6. Once all the disks copied to another region, Important thing we need to create a disks from that
storage
7. Next step, We need to new Cloud Service in another region
8.Then start to spin up the VM, Go to portal https://portal.azure.com -> More Services -> search OS disks -> find out the
disks which had created from that storage account, then you can select the new cloud service and virtual network click
finish.

!!!! Now Server is created on another region!!!!!

Saturday, 17 September 2016

Solution for User Profile Service service failed the Sign-in user cannot be loaded on Windows Server 2012 Server

Solution for User Profile Service service failed the Sign-in user cannot be loaded on Windows Server 2012 Server

Today, I faced this error in one of my production Server, I went for google search to find this error but unfortunately couldn't get the solution.


I got from error message while  analysis on eventvwr inside that server,



Screenshot :








Then, I given full access to managed document folder, but no luck couldn't succeed.!!!!!!!!!!
Finally, I started compared with other windows 2012 server with same above mentioned path. Surprise!! there is no objects available inside the templates folders, then i compared some other servers, same no objects are available.

Then Confidently deleted whatever available inside that templates, then i tried login into my domain users, yes!! Successfully i can able to login it... :-)





Application Gateway Using Azure Power Shell

Application gateway using Azure PowerShell

Steps to configure the Application gateway

1. Download and Install the Azure windows power-shell
2. Add your azure azzount using this command : Add-AzureAccount
3. Once login into your account, get the azure Subscriptions whatever available in your azure account
Command : Get-AzureSubscription
4.Select the particular azure Subscription, from where those instances are available for configure the
application gateway
Command : Get-AzureSubscription
5.Next, We have to create a new application gateway using below command
Command : New-AzureApplicationGateway -Name AppGw -VnetName uvnet-Subnets @(Subnet-1")
6.Should be validate, the created application gateway
Command : Get-AzureApplicationGateway AppGw
7.Next Step, We need to create the SslCert
Command :  Add-AzureApplicationGatewaySslCertificate SslCert
8. The Step to add the application gateway certificate, We should copy our sslcertificate in
our local drive path for any name
Command : Add-AzureApplicationGatewaySslCertificate  -Name AppGw -CertificateName SslCert -Password
password -CertificateFile d:/mention the ssl certificate copied path here
9.Validate the application gateway SslCertificate
Command : Get-AzureApplicationGatewaySslCertificate AppGw
you may get the Output like this

VERBOSE: 12:10:26 PM - Begin Operation: Get-AzureApplicationGatewaySslCertificate
VERBOSE: 12:10:29 PM - Completed Operation: Get-AzureApplicationGatewaySslCertificate


Name           : SslCert
SubjectName    : CN=*.test.com, OU=tesct Sys, O=Test Sys Ltd, L=Chennai, S=Tamil Nadu, C=IN
Thumbprint     : DBAA15446ACF788BEA2CA555CFB69C69ECA09293
ThumbprintAlgo : sha256RSA
State          : Provisioned
10.Then, we have configure the Configfile of application gateway

Below, I'm Sharing the sample xml fle for configuring the xml depends on your requirement, Can configure http, https listeners etc.

<ApplicationGatewayConfiguration xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<FrontendIPConfigurations>
<Name>fep1</Name>
<Port>80</Port>
<FrontendPort>
</FrontendPort>
<FrontendPorts>
</FrontendPorts>
<Name>pool1</Name>
<IPAddress>10.0.0.1</IPAddress>
<IPAddress>10.0.0.2</IPAddress>
<IPAddresses>
</IPAddresses>
<BackendAddressPool>
</BackendAddressPool>
<BackendAddressPools>
</BackendAddressPools>
<Name>setting1</Name>
<Port>80</Port>
<Protocol>Http</Protocol>
<CookieBasedAffinity>Enabled</CookieBasedAffinity>
<BackendHttpSettings>
</BackendHttpSettings>
<BackendHttpSettingsList>
</BackendHttpSettingsList>
<Name>listener1</Name>
<FrontendPort>port1</FrontendPort>
<Protocol>Http</Protocol>
<HttpListener>
</HttpListener>
<HttpListeners>
</HttpListeners>
<Name>rule1</Name>
<Type>Basic</Type>
<BackendHttpSettings>setting1</BackendHttpSettings>
<Listener>listener1</Listener>
<BackendAddressPool>pool1</BackendAddressPool>
<HttpLoadBalancingRule>
</HttpLoadBalancingRule>
<HttpLoadBalancingRules>
</HttpLoadBalancingRules>
</FrontendIPConfigurations>
</ApplicationGatewayConfiguration>

Once modifying the xml file, copied in to local drive path same as Certificate path.

11. Next Step, we should create config file using created config.xml file
Command : Set-AzureApplicationGatewayConfig -Name AppGw -ConfigFile c:/Mention the config.xml drive path

12. Atlast, we finished all the steps for configuring the application gateway. Then we need to start our application gateway

Command : Start-AzureApplicationGateway AppGw

13. Final Step, we have get the azure application gateway

Command : Get-AzureApplicationGateway AppGw

Tuesday, 13 September 2016

Get Local Administrators using PowerShell

Copy & Paste the below powershell script in Windows Powershell

Function Get-LocalGroup  {

  [Cmdletbinding()]

  Param(

  [Parameter(ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)]

  [String[]]$Computername =  $Env:COMPUTERNAME,

  [parameter()]

  [string[]]$Group

  )

  Begin {

  Function  ConvertTo-SID {

  Param([byte[]]$BinarySID)

  (New-Object  System.Security.Principal.SecurityIdentifier($BinarySID,0)).Value

}
        Function  Get-LocalGroupMember {

  Param  ($Group)

  $group.Invoke('members')  | ForEach {

  $_.GetType.Invoke().InvokeMember("Name",'GetProperty', $null, $_, $null)

  }

  }

  }

  Process  {

  ForEach  ($Computer in  $Computername) {

  Try  {

  Write-Verbose  "Connecting to $($Computer)"

  $adsi  = [ADSI]"WinNT://$Computer"

  If  ($PSBoundParameters.ContainsKey('Group')) {

  Write-Verbose  "Scanning for groups: $($Group -join ',')"

  $Groups  = ForEach  ($item in  $group) {                       

  $adsi.Children.Find($Item, 'Group')

  }

  } Else  {

  Write-Verbose  "Scanning all groups"

  $groups  = $adsi.Children | where {$_.SchemaClassName -eq  'group'}

  }

  If  ($groups) {

  $groups  | ForEach {

  [pscustomobject]@{

  Computername = $Computer

  Name = $_.Name[0]

  Members = ((Get-LocalGroupMember  -Group $_))  -join ', '

  SID = (ConvertTo-SID -BinarySID $_.ObjectSID[0])

  }

  }

  } Else  {

  Throw  "No groups found!"

  }

  } Catch  {

  Write-Warning  "$($Computer): $_"

  }

  }

  }

  }

Then, Mentioned the computer names which you want to get the users list from administrator groups and then save the txt file

In powershell ->  $Computers = Get-Content C:\Computers.txt

Then, using the below script, you can get the local admin users with format

Get-LocalGroup -Computername $computers -Group  Administrators | Select ComputerName, Name, Members | Format-Table -AutoSize