RSS

Author Archives: NesiSamurai

Domain controller – Domain clients time problem

For some reason domain clients stopped getting correct time from Domain controller. Clients were taking time from Local CMOS. This can be fixed by the following steps. Run the following commands as administrator.

  • On DC check last sync time: w32tm /query /status
  • step 1 on DC: w32tm /config /manualpeerlist:time.windows.com /syncfromflags:manual /reliable:yes /update
  • step 2 on DC: net stop w32time && net start w32time
  • step 3 on client: w32tm /config /syncfromflags:domhier /update
  • step 4 on client: net stop w32time && net start w32time

This solution is derived from the following post i found in stackexchange

I went thru all the above on my domain joined Windows 10 machine trying to get it to resync. What fixed this for me was I first ran DCDIAG on my domain controller and saw the error that said this server is not advertising as a time server. So then I ran w32tm /query /status on my DC. Which returned an answer of vmnic something. My DC was using the time integration services from the Hyper-V host. I went to the Hyper V Manager and went to the setting on my DC and removed the check box from time integration services. Then I reset my DC to use an external time source: w32tm /config /manualpeerlist:time2.google.com /syncfromflags:manual /reliable:yes /update Then run: net stop w32time and net start w32time Now when I went back to my Windows 10 clients I could run: w32tm /config /syncfromflags:domhier /update and net stop w32time and then net start w32time That fixed the time sync immediately. After about 15 minutes the rest of my domain joined PC’s had also updated to the correct time. Hope this helps you! (by: steve s)

 
Leave a comment

Posted by on November 25, 2021 in Windows

 

Windows: Export EventLog from command line

(Copy pasted from: michlstechblog.info)

Windows has a builtin command line utility to deal with Eventlogs: wevtutil

Some examples.

List all registered Eventlogs
D:> wevtutil el


Export the System EventLog to a file
D:> wevtutil epl System c:\%Computername%_System_log.evtx

Export the Application EventLog to a file
D:> wevtutil epl Application c:\%Computername%_Application_log.evtx

Or the Remote Desktop EventLog to a file
D:> wevtutil epl Microsoft-Windows-RemoteDesktopServices-RdpCoreTS/Operational c:\%Computername%_rdp_log.evtx


Search the last 100 Entries in Application EventLog for an Event with ID 1704 as Text
D:> wevtutil qe Application /q:”Event/System/EventID=1704″ /c:100 /f:text

(%Computername% will be replaced by the name of your computer in exported files name)

 
Leave a comment

Posted by on September 7, 2021 in Windows

 

VCRUNTIME140_1.dll not found error when opening Excel

Solution: download and install both the x86 and x64 versions of the Microsoft Visual C++ 2015 – 2019 Redistributable, that should resolve this

Download page

x86: vc_redist.x86.exe

x64: vc_redist.x64.exe

 
Leave a comment

Posted by on August 28, 2021 in excel

 

Outlook 365 – “Need password” but no prompt when clicked – issue

(below details are copy-pasted from Microsoft forum)

POST 1:

Some of our users’ outlook stop sync with exchange and ask for password, as shown in below image:

thumbnail image 1 of blog post titled 
	
	
	 
	
	
	
				
		
			
				
						
							Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue
							
						
					
			
		
	
			
	
	
	
	
	

	
	
	 
	
	
	
				
		
			
				
						
							Re: Outlook (365) Need Password - Issue

But when we press the “Need Password” button, nothing happens. there is no prompt.

to fix the issue, I clear entries in Credential Manager, Delete Temporary Files, unchecked “Use Cached Exchange mode”, restart system and check this again.

POST 2: (Confirmed accepted answer)

There are a number of reasons for this. First I would look inside the Office 365 admin portal to make sure your password expiration policy is not set to only a few days

If this is ok, setting the below registry key to 1 in below path often resolves it

Path: HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity
Key: DisableADALatopWAMOverride (DWORD)

This key may not exist, we need to create it.

 
Leave a comment

Posted by on August 28, 2021 in Uncategorized

 

Excel Remove some letters from a cell and extract some values from the rest.

In a specific situation where you want to remove the certain number of characters from a cell, and you want to take a part of the number out. You can use this formula.

Example: I have a cell with this value 0107856985652HJKG. I need to remove the first three values, then take the next 10 characters out.

010 7856985652 HJKG

=LEFT((RIGHT(CellWithYourValue,LEN(CellWithYourValue)-NumberOfLettersToRemoveFromBeginning)),NumberOfLettersToTakeAfterRemoval)

If my value wan in cell A1 the formula will look like this ==>

=LEFT((RIGHT(A1,LEN(A1)-3)),10)

 
Leave a comment

Posted by on August 17, 2021 in excel, Windows

 

Split A Workbook To Separate Excel Files With VBA Code

The following VBA code can help you quickly split multiple worksheets of current workbook to separate Excel files, please do as follows:

1. Create a new folder for the workbook that you want to split, because the split Excel files will be stayed at the same folder as this master workbook.

2. Hold down the ALT + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.

3. Click Insert > Module, and paste the following code in the Module Window.

VBA: Split a workbook into multiple workbooks and save in the same folder

Sub Splitbook()
'Updateby20140612
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
    xWs.Copy
    Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
    Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

4. Click F5 to run the code

(Above info is copied from here >> external link)

 
Leave a comment

Posted by on August 7, 2021 in Uncategorized

 

Google Sheets – Add a Pop-Up Calendar Date Picker

Step 1: Select the cells where you want the pop-up then from menu Data> validation

Step 2: select date from validation criteria and click save

OK now when you click the selected cell from step 1 you will get a pop-up calender.

 
Leave a comment

Posted by on June 14, 2021 in Uncategorized

 

HikVision devices Naming Rules

 
Leave a comment

Posted by on June 2, 2021 in Uncategorized

 

Bulk add alias in Microsoft 365 Exchange using powershell.

The following steps will add a new alias to given emails. It will not make the new alias as primary.

  1. Open a persistant session to the exchange.
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

02.Import the session to your powershell:
Import-PSSession $Session

03.Login to Microsoft 365 admin account
Connect-Msolservice

  1. Download Global address list.
    get-user -resultsize unlimited |select * |export-csv c:\M365\users.csv
  2. Delete all columns except “Identity”.
  3. Add a new column named “Alias”.
  4. After updating the sheet run the following script.

$Recipients = Import-Csv C:\M365\users.csv
Foreach ($Item in $Recipients)
{
Set-Mailbox -Identity $Item.Identity -EmailAddresses @{Add=$Item.Alias}
}

(This note is based on what I did today. I have very little understanding of powershell, if you are going to try these steps please do your research first.)

 
Leave a comment

Posted by on May 31, 2021 in Uncategorized

 

Bulk Update User information in Microsoft 365 Exchange using powershell.

Note for future reference:

  1. Open a persistant session to the exchange.
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

It will ask for your credentials.

  1. Import the session to your powershell:
    Import-PSSession $Session
  2. Login to Microsoft 365 admin account (to use MsolUser Cmdlet)
    Connect-Msolservice (It will ask for your credentials.)
  3. Download the contents of your Exchange Global Address list to a CSV file
    get-user -resultsize unlimited |select * |export-csv c:\MS365\users.csv
  4. Remove unneccessry columns and edit what you need. (dont delete the columns named UserPrincipalName and Identity we need to use them later.)
    In this usecase I will use Set-MsolUser module, which supports the following options.

Set-MsolUser
[-ImmutableId ]
[-ObjectId ]
[-UserPrincipalName ]
[-BlockCredential ]
[-City ]
[-Country ]
[-Department ]
[-DisplayName ]
[-Fax ]
[-FirstName ]
[-LastName ]
[-LastPasswordChangeTimestamp ]
[-MobilePhone ]
[-Office ]
[-PasswordNeverExpires ]
[-PhoneNumber ]
[-PostalCode ]
[-PreferredDataLocation ]
[-PreferredLanguage ]
[-SoftDeletionTimestamp ]
[-State ]
[-StreetAddress ]
[-StrongPasswordRequired ]
[-Title ]
[-UsageLocation ]
[-AlternateEmailAddresses ]
[-StrongAuthenticationMethods ]
[-AlternateMobilePhones ]
[-StrongAuthenticationRequirements ]
[-StsRefreshTokensValidFrom ]
[-UserType ]
[-TenantId <Guid>]

  1. After updating the CSV, import the updated csv to powershell and execute the changes.

in the below script, header names referenced with a hyphon are the names we used in our sheet. header names referenced with $_. are the ones that the exchange is expecting from us. To make it simpler I used the same names as exchange in my sheet.

to map a field to a field in exchange we use this syntax : – $_.

Import-Csv C:\M365\users.csv | foreach{Set-MsolUser -UserPrincipalName $_.UserPrincipalName -DisplayName $_.DisplayName -FirstName $_.FirstName -LastName $_.LastName -City $_.City -StreetAddress $_.StreetAddress -Department $_.Department -Country $_.Country -MobilePhone $_.MobilePhone}

supported field names are shown in step 5.

In this script we are using UserPrincipalName as the main reference.

After running this script it takes a few minutes to be able to see your changes in the Exchange Admin portal.

(This note is based on what I did today. I have very little understanding of powershell, if you are going to try these steps please do your research first.)

 
Leave a comment

Posted by on May 31, 2021 in Uncategorized