Wednesday, October 20, 2021

SQL intellisense not working

The following are not a sequence of steps. You can try each one of these and something might work.

Check if you have  intellisense enabled.

 

If the Intellisense is not working only for certain databases.Keep the top check box enabled but remove the underline errors and outline statements.  Open a new query window and check.


  Disable SQLCMD mode.

 

Refresh Local Cache.


Thursday, October 7, 2021

Azure Powershell change dynamic ip to static for a VM.

 

Select-AzContext -Subscription "YourSubscriptionname"

 

get-azsubscription to get a list of all subscriptions you have access to.

 

Set-AzContext  -subscriptionname "yoursubscriptionname"

 

 Change dynamic to static for a single VM

$If = Get-AzNetworkInterface | ?{$_.virtualmachine.id -match "yourvm"}
$Nic = Get-AzNetworkInterface -ResourceGroupName $If.resourcegroupname -Name $if.name
$Nic.IpConfigurations[0].PrivateIpAllocationMethod
$Nic.IpConfigurations[0].PrivateIpAllocationMethod = "Static"
Set-AzNetworkInterface -NetworkInterface $Nic

 

View all Vm's with dynamic ip's

$DynamicIfs = Get-AzNetworkinterface | ?{$_.IpConfigurations[0].PrivateIpAllocationMethod -eq "Dynamic"}
foreach($if in $DynamicIfs)
{
$Nic = Get-AzNetworkInterface -ResourceGroupName $If.resourcegroupname -Name $if.name
Write-host $If.Virtualmachine.Id $Nic.IpConfigurations[0].PrivateIpAllocationMethod
}

 

Change dynamic to static for all VM's. 

$DynamicIfs = Get-AzNetworkinterface | ?{$_.IpConfigurations[0].PrivateIpAllocationMethod -eq "Dynamic"}
foreach($if in $DynamicIfs)
{
$Nic = Get-AzNetworkInterface -ResourceGroupName $If.resourcegroupname -Name $if.name
$Nic.IpConfigurations[0].PrivateIpAllocationMethod
$Nic.IpConfigurations[0].PrivateIpAllocationMethod = "Static"
Set-AzNetworkInterface -NetworkInterface $Nic
}



Friday, September 17, 2021

Remote server administration tools not installing.

 The option to enable windows administrations tools is missing.

 

 

 

Install powershell 7 and run the following command.


Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online

Download powershell 7 from here.

https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7.1