How to change network names on Windows 10

Firstly I take no credit for this, the original article can be found here.

When you connect to a network for the first time in Windows, Windows saves the network profile and assigns a name to it.

Connections using Ethernet (wired) use a generic name such as Network 7 usually while wireless networks the SSID of the Wi-Fi network the device connected to.

Some users and administrators may dislike the non-descriptive nature of wired network connections on Windows.

Good news is that it is possible to rename network profile names to make them more descriptive on the operating system.

The following guide was written for Microsoft’s Windows 10 operating system but the process should work in previous versions of Windows as well.

Changing the network name on Windows

You can check the current name in the Network and Sharing Center on Windows or in the Settings application on Windows 10.

  1. Tap on Windows-I to open the Settings application.
  2. Go to Network & Internet > Ethernet or Wi-Fi depending on the connection type.

The name of the network is displayed at the very top of the page.

To display the name in the Control Panel instead, do this:

  1. Tap on the Windows-key to activate the Start menu.
  2. Type Control Panel and select the result.
  3. Go to Network and Sharing Center

The name is listed under “view your active networks”.

Windows administrators and users have two main options to change a network name. The first involves editing the Windows Registry using Local Security Policy. Note that Local Security Policy is only available in professional versions of Windows, e.g. Windows 10 Pro.

Using the Windows Registry

I recommend that you back up the Windows Registry before you make any changes to it. Check out ghacks.net Windows Registry backup guide to find out how to do that.

  1. Open the Start Menu.
  2. Type regedit.exe and select the result to open the Registry Editor.
  3. Confirm the UAC prompt that is displayed.
  4. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles
  5. The next step requires some trial and error. Windows lists all network connections with a unique ID and you need to click on each to check the ProfileName variable of it until you find the network name that you want to change.
  6. Double-click on ProfileName once you have found the right entry and type the new name of the network that you want used on the device. The change is only active on the device.

The change takes affect immediately. You can verify that by opening the Settings app or the Network and Sharing Center to verify that the name change was successful.

Repeat the process for any other network name that you want to change.

Webcam not working in Microsoft Teams

Recently my webcam had been playing up when joining Microsoft Teams meetings. Sometimes i’d connect to a call, audio works but video doesn’t. I could toggle the show/hide video icon and it would start working but it got worse and wouildn’t work at all.

After a bit of digging I found this article on the web and it was the following Powershell command that fixed it…

Get-AppxPackage -allusers Microsoft.WindowsCamera | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

Add a guest to a team in Microsoft Teams

How do you add a guest to Microsoft teams? How does a guest join a team?

If you are trying to figure out how to add an external member to a full blown team, not just a chat or meeting then below are some articles on how to do this.

https://docs.microsoft.com/en-us/microsoftteams/guest-joins

A team owner in Microsoft Teams can add and manage guests in their teams via the web or desktop. Anyone with a business or consumer email account, such as Outlook, Gmail, or others, can participate as a guest in Teams, with full access to team chats, meetings, and files. Only people who are outside of your organisation, such as partners or consultants, can be added as guests. People from within your organisation can join as regular team members.

By default, guest access is turned off. So, before guests can join a team, an admin must turn on guest access in Teams. To do that, use the link below…

https://docs.microsoft.com/en-us/microsoftteams/guest-access-checklist

If you are looking for general information on what microsoft teams is and how it works then the following video is pretty useful.

Office 2010 cmd activate or change product key

Yes it’s 2020 and we’re still messing around with Office 2010! If you’re having issues with license keys not working, activation problems etc then here’s a few useful commands.

Activate Office

Open CMD as Administrator.

cd c:\Program Files (x86)\Microsoft Office\Office14
cscript ospp.vbs /act

Change Product Key

cscript ospp.vbs /inpkey:XXXXX-YYYYY....

Connect to VPN from desktop in Windows 10

  1. Right click the Desktop and select New – Shortcut.
  2. In the shortcut target box, type or copy-paste the following command:
    rasphone -d "VPN connection name"
  3. Set the desired icon and name for your shortcut.

Once you do this, just click this shortcut to connect to a VPN directly. You can pop it anywhere you wish. To disconnect you can do the same but use the following instead…

rasphone -h “VPN connection name”

Outlook won’t accept “app password” after setting up MFA

So we use Exchange Online Plan 1 and Outlook 2016. After setting up Multi-factor Authentication for one of my email accounts I found that after a couple of days Outlook started popping up the password prompt for the account.

No matter how many times I tried it wouldn’t accept the “app password” i created here or the normal password for the account. After a bit of digging I found this article which suggested adding the following registry key which solved the problem for me.

HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity
DisableADALatopWAMOverride
dword value 1

Export all AD groups and their members to CSV file

Export all Active Directory groups, the group category, group scope and all group members to a CSV file. Active Directory PowerShell module is required. Tested on Windows Server 2012 R2 and Windows Server 2016. Amend $DateTime variable format and $CSVFile for path and filename.

#// Start of script 
#// Get year and month for csv export file 
$DateTime = Get-Date -f "yyyy-MM" 
 
#// Set CSV file name 
$CSVFile = "C:\AD_Groups"+$DateTime+".csv" 
 
#// Create emy array for CSV data 
$CSVOutput = @() 
 
#// Get all AD groups in the domain 
$ADGroups = Get-ADGroup -Filter * 
 
#// Set progress bar variables 
$i=0 
$tot = $ADGroups.count 
 
foreach ($ADGroup in $ADGroups) { 
    #// Set up progress bar 
    $i++ 
    $status = "{0:N0}" -f ($i / $tot * 100) 
    Write-Progress -Activity "Exporting AD Groups" -status "Processing Group $i of $tot : $status% Completed" -PercentComplete ($i / $tot * 100) 
 
    #// Ensure Members variable is empty 
    $Members = "" 
 
    #// Get group members which are also groups and add to string 
    $MembersArr = Get-ADGroup -filter {Name -eq $ADGroup.Name} | Get-ADGroupMember | select Name, objectClass, distinguishedName 
    if ($MembersArr) {  
        foreach ($Member in $MembersArr) {  
            if ($Member.objectClass -eq "user") { 
                $MemDN = $Member.distinguishedName 
                $UserObj = Get-ADUser -filter {DistinguishedName -eq $MemDN} 
                if ($UserObj.Enabled -eq $False) { 
                    continue 
                } 
            } 
            $Members = $Members + "," + $Member.Name  
        } 
        #// Check for members to avoid error for empty groups 
        if ($Members) { 
            $Members = $Members.Substring(1,($Members.Length) -1) 
        } 
    } 
 
    #// Set up hash table and add values 
    $HashTab = $NULL 
    $HashTab = [ordered]@{ 
        "Name" = $ADGroup.Name 
        "Category" = $ADGroup.GroupCategory 
        "Scope" = $ADGroup.GroupScope 
        "Members" = $Members 
    } 
 
    #// Add hash table to CSV data array 
    $CSVOutput += New-Object PSObject -Property $HashTab 
} 
 
#// Export to CSV files 
$CSVOutput | Sort-Object Name | Export-Csv $CSVFile -NoTypeInformation 
 
#// End of script

Original article found here https://gallery.technet.microsoft.com/scriptcenter/Export-all-AD-groups-and-3ae6fb42

Office 2019 Install

https://msguides.com/microsoft-software-products/office-2019.html

Download & Install Office 2019 http://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/en-us/ProPlus2019Retail.img

Open command prompt with admin rights and type

cd /d %ProgramFiles%\Microsoft Office\Office16

or

cd /d %ProgramFiles(x86)%\Microsoft Office\Office16

then each of the following lines individually

for /f %x in ('dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x"
cscript ospp.vbs /setprt:1688
cscript ospp.vbs /unpkey:6MWKP >nul
cscript ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP
cscript ospp.vbs /sethst:kms8.msguides.com
cscript ospp.vbs /act

Outlook 2010, 2013 & 2016 Wont Archive Emails Fix

Problem;-
Outlook will not let me archive old emails to a .pst file. The reason I want to do this is to free up space in my exchange online mailbox as it’s nearing it’s limit. I can tell it to do an archive, specify a date etc but it does nothing and all the old emails I told it archive are still there.

Solution;-
Outlook for some reason decides to archive based on modified date not sent or received date that you would expect. To remedy this you must first make sure that if you are using Outlook 2010 then you have applied the following hotfix first (not needed for 2013 or 2016) then add the following entry to the Registry.

Key for Outlook 2010: 
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Preferences
Key for Outlook 2013: 
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Preferences
Key for Outlook 2016: 
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences

Value name: ArchiveIgnoreLastModifiedTime
Value type: REG_DWORD
Value: 1

You must restart Outlook after you add the ArchiveIgnoreLastModifiedTime registry.

Archiving should now work as expected.

How to Check Index Fragmentation on Indexes in a SQL Database

Firstly I would like to point out that the following article was copied from here so all credit goes to them. I found it while tying to find out why one of our databases was incredibly slow!

Issue

SQL Queries taking longer than normal to complete.

Environment

SQL Server 2005, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014, SQL Server 2016

When a database is frequently updated via INSERT, UPDATE, or DELETE statements we can expect it to become fragmented over the time.

If database indexes are fragmented, the SQL Server query optimizer may chose a non-optimal execution plan when using an index to resolve a query.

This will affect the overall query performance and you may notice a query behaving slower than normal.

Resolution

**Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.**

The following is a simple query that will list every index on every table in your database, ordered by percentage of index fragmentation.

SELECT dbschemas.[name] as 'Schema',
dbtables.[name] as 'Table',
dbindexes.[name] as 'Index',
indexstats.avg_fragmentation_in_percent,
indexstats.page_count
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS indexstats
INNER JOIN sys.tables dbtables on dbtables.[object_id] = indexstats.[object_id]
INNER JOIN sys.schemas dbschemas on dbtables.[schema_id] = dbschemas.[schema_id]
INNER JOIN sys.indexes AS dbindexes ON dbindexes.[object_id] = indexstats.[object_id]
AND indexstats.index_id = dbindexes.index_id
WHERE indexstats.database_id = DB_ID()
ORDER BY indexstats.avg_fragmentation_in_percent desc

This query can be modified to focus on specific tables by append the table name to the ‘where’ clause:

WHERE indexstats.database_id = DB_ID() AND dbtables.[name] like '%%'

In order to reduce fragmentation we will have to reorganize or rebuild the indexes. Choosing between reorganizing or rebuilding depends on the query results.

For heavily fragmented indexes a rebuild process is needed, otherwise index reorganisation should be sufficient.

The following info summarises when to use each one:

Reference Values (in %): avg_fragmentation_in_percent > 5 AND < 30
Action: Reorganise Index
SQL Statement: ALTER INDEX REORGANIZE

Reference Values (in %): avg_fragmentation_in_percent > 30
Action: Rebuild Index
SQL Statement: ALTER INDEX REBUILD

In my case I then did the following…

DECLARE @TableName VARCHAR(255)
DECLARE @sql NVARCHAR(500)
DECLARE @fillfactor INT
SET @fillfactor = 80
DECLARE TableCursor CURSOR FOR
SELECT '[' + OBJECT_SCHEMA_NAME([object_id])+'].['+name+']' AS TableName
FROM sys.tables
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
SET @sql = 'ALTER INDEX ALL ON ' + @TableName + ' REBUILD WITH (FILLFACTOR = ' + CONVERT(VARCHAR(3),@fillfactor) + ')'
EXEC (@sql)
FETCH NEXT FROM TableCursor INTO @TableName
END
CLOSE TableCursor
DEALLOCATE TableCursor
GO