Tuesday, October 6, 2020

Ho to change LDAP Attribute values

 Just want to share a piece of information that recently we got the requirement from the project team (SAP) why with every WildCart search only get up to 1000 record despite having multiple entries in Windows AD in their application tool. To be honest, I am not aware of that behavior/limitation, so post going through the blogs on the internet came to know it’s the default behavior of LDAP configuration but there is an option to change it the LDAP parameter value (MaxPageSize) so that LDAP search will not restrict to 1000 records. So I thought to share the SOP like how to change the LDAP parameter values in the domain.

How we can view or change MaxPageSize value?

Open ntdsutil













Monday, May 25, 2020

Azure - Custom Power-Shell Script for Azure VM's Inventory

Below is the custom script to get Azure VM's inventory.



clear
$password = ConvertTo-SecureString 'PutPassword -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ('PutLoginName', $password)

Login-AzureRmAccount -Credential $cred

$AZSub=Get-AzureRmSubscription


$Cdate = Get-Date

$text="<html>"
$text= $text + "<head>"
$text= $text + "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>"
$text= $text + "<title>O365 License Report</title>"
$text= $text + "</head>"
$text= $text + "<body><br>"
$text= $text + "<table width='50%' cellpadding=0 cellspacing=0 style='border:1px solid #000'>"
$text= $text + "<tr>"
$text= $text + "<td colspan='9' height='25' align='center'>"
$text= $text + "<font face='tahoma' color='#003399' size='4'><strong>Azure VM's Inventory - $Cdate </strong></font>"
$text= $text + "</td>"
$text= $text + "</tr>"
#$text= $text + "</table >"
#$text= $text + "<table width='50%' cellpadding=0 cellspacing=0 style='border:1px solid #000'>"
$text= $text + "<tr>"
$text= $text + "<td width='20%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px; font-weight:bold'>Subscription</td>"
$text= $text + "<td width='20%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px; font-weight:bold'>Name</td>"
$text= $text + "<td width='20%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px; font-weight:bold'>ResourceGroupName</td>"
$text= $text + "<td width='30%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px; font-weight:bold'>VmID</td>"
$text= $text + "<td width='20%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px; font-weight:bold'>Location</td>"
$text= $text + "<td width='20%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px; font-weight:bold'>ProvisioningState</td>"
$text= $text + "<td width='10%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px; font-weight:bold'>StatusCode</td>"
$text= $text + "<td width='10%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px; font-weight:bold'>PowerStatus</td></tr>"

foreach ($AZSub1 in $AZSub)
{


 
   if ($AZSub1.Name -eq 'Chennai-DC' -or $AZSub1.Name -eq 'Birlasoft Azure - ADFS')
    {
       $AZSubName = $AZSub1.Name
       Select-AzureRmSubscription -SubscriptionName $AZSub1.Name

       $VM=Get-AzureRmVM -Status | select PowerState,ResourceGroupName,VmId,Name,Location,ProvisioningState,StatusCode
       foreach ($vm1 in $vm)
        {
       $VMName=$vm1.Name
       $RSGName=$vm1.ResourceGroupName
       $VMid=$vm1.VmId
       $VMLoc=$vm1.Location

       $ProState=$vm1.ProvisioningState
       $VmStatus=$vm1.StatusCode
       $PState=$vm1.PowerState
       $text= $text + "<tr>"
        $text= $text + "<td width='20%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px;'>$AZSubName</td>"
$text= $text + "<td width='20%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px;'>$VMName</td>"
$text= $text + "<td width='10%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px;'>$RSGName</td>"
        $text= $text + "<td width='30%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px;'>$VMid</td>"
        $text= $text + "<td width='10%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px;'>$VMLoc</td>"

        $text= $text + "<td width='10%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px;'>$ProState</td>"
        $text= $text + "<td width='10%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px;'>$VmStatus</td>"
        $text= $text + "<td width='10%' align='center' style='border: 1px solid black;padding: 5px; font-family:tahoma;font-size:14px;'>$PState</td>"
        $text= $text + "</tr>"
        }


    }
   
}

$text= $text + "</body>"
$text= $text + "</html>"

$text | Set-Content 'C:\Users\sunilkumag\Desktop\AzureInventory.html'

Friday, February 7, 2020

Enable Dot NET 3.5 Windows 10

Copy sxs folder to local system

run below command



Dism /online /enable-feature /featurename:NetFx3 /All /Source:D:\sxs /LimitAccess