Posts

Showing posts with the label Windows Server

Wanna disable SMBv1 to stop WannaCry

Link from Technet why SMBv1 should be disabled:

STOP using SMBv1

Link below shows how to to check whether SMBV1 is enabled and how to disable SMBV1:

How to disable SMBv1? - How to check if SMBv1 is enabled?


PowerShell codes below is from the link above:

Windows 8 and Windows Server 2012

To check whether SMB1 and SMB2 are enabled:

Get-SmbServerConfiguration | Select EnableSMB1Protocol, EnableSMB2Protocol

To disable SMBv1 on the SMB server, run the following cmdlet:

Set-SmbServerConfiguration -EnableSMB1Protocol $false

=====================

Windows 7, Windows Server 2008 R2, Windows Vista, and Windows Server 2008

Requires Windows PowerShell 2.0 or a later version of PowerShell

To disable SMBv1 on the SMB server, run the following cmdlet:

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 -Force

Or if you're not comfortable using PowerShell just open registry editor and do it manually.

PowerShell is quite straight forw…

How to insert landscape orientation in Word?

Image
If you are writing a thesis, a report or an article that you need to insert a landscape layout in a specific page in Word document but your orientation all long is portrait and changing the orientation causes the whole layout to change.
Inserting landscape in a specific page in a word document can be done by inserting section breaks. Let’s just make a basic example.
Let’s say you have 3 page document and you want that first page in Portrait mode, second page in landscape and third page in portrait layout also.
First, click on “home” tab, click the “show/hide paragraph marks” option or see the icon below. Enabling this option the section breaks, spaces and tabs will be visible. But what we are interested is to see the “section breaks”.


In the first page position the cursor on the last area at the bottom of the page.
In Word 2010, click on “page layout” in the ribbon tab. Click on “breaks” and select “next page”. In the second page, position also the cursor at the middle or bottom of t…

PowerShell copy file, link or folder to users’ desktop

Deploying a shortcut link, file or folders can easily be done via group policy preferences.
Or it can also be done using PowerShell as logon or start up script.
A one liner code snippet to deploy a file, a shortcut links or a folder to user’s desktop.
Copy a file: copy-item "\\shared_folder\files_2be_copied.txt" "c:\users\public\desktop"
Copy a shortcut link to user desktop: copy-item "\\shared_folder\shortcut_file_2be_copied.lnk" "c:\users\public\desktop"
Copy a folder: copy-item "\\shared_folder\folder_2be_copied" "c:\users\public\desktop" -Container -Recurse


================================ Free Android Apps:
Click on links below to find out more:
Linux Android App cheat sheet: https://play.google.com/store/apps/details?id=com.LinuxMobileKit
Multiplication Table for early learnershttps://play.google.com/store/apps/details?id=com.TableMultiplication
Catholic Rosary Guide  for Android:
https://play.google.com/store/apps/details?id=com.my…

PowerShell move matching files in a folder

Requires PS 3.0
This is a two lines code snippet to move matching files in a source folder to another folder.
#==============================

$SourceFolder = "C:\File_monitor_records\"
# Find all files matching *.csv in the folder specified  # Find csv files with 2016 in its filename Get-ChildItem -Path $SourceFolder -Filter *2016*.csv | move-item  -destination C:\File_monitor_archives\2016\

#==============================
-Filter *2016*.csv –adjust or create your own pattern, use regex if necessary
Test the pattern before moving the files to make sure correct files are being moved. Check and double check, to avoid wasting time and effort.
This will just like matching files.

Get-ChildItem -Path $SourceFolder -Filter *2016*.csv


Move files and change file name:
http://quickbytesstuff.blogspot.sg/2015/06/powershell-move-files-and-change-file.html

================================ Free Android Apps:
Click on links below to find out more:
Linux Android App cheat sheet: https://play.google.com/s…

Folder redirection very slow

Folder redirection is good and bad, well if everything is working as expected then it's definitely good and sometimes it's bad if it causes some unexpected issues such as very slow login.
So you have a folder redirection working  smoothly over the years, users can always change their password whenever they want it and of course, System Administrator can also change user password anytime whenever they want it or whenever they just felt like changing it (just kidding), or when situations demand it.
If folder redirection suddenly becomes problematic or causes some issue such as slow login, one issue could be that the user changes the password or the Sys Ad change the user password.
One issue I encountered if the folder redirection suddenly becomes slow, if the client or the user has a mapped drive that is set manually and set to persistent, persistent mapped drives uses the Vault Credential Manager to store the password.
If the password is not updated in the vault credential man…

Active Directory GPO apply to forest

How to apply GPO to whole forest?

1. Open GPMC (Group Policy Management Console) and create a GPO for a single domain.

2. Link the GPO to other domains in the forest.
   Right click each domain and select "Link an Existing GPO Here" then select the GPO that will be applied to all domains in the forest.

3. If everything works fine, then you're a lucky man.


Before rolling out a GPO create a test Organizational Unit and create Active Directory user accounts for test purposes.

Then apply the GPO to the OU.

If it works properly then there's a good chance that it will work smoothly to all users but it's not a guarantee that it will work correctly to all users.

If the GPO is critically needed to be applied to all users and testing works okay, roll out the GPO and troubleshoot issues that may occur.

If no problem arises, then drink a cup of coffee and consider yourself "lucky".

If the GPO is not yet tested and you are not sure whether it will havoc the Active Directory …

PowerShell get filename with extension

#=======================================

$Folder_file_path="D:\test_folder\"
$initCount=0

[array]$data_files = Get-ChildItem $Folder_file_path  #get all items and save to array

  $i_count=$data_files.count  #count items on the array and assign to $i_count variable

  Write-Host $initCount   #optional to display count value

#if statement to process if files are found

if($data_files.count -gt 0){


#increment for loop from zero to last index of the array
 for  ($initCount; $initCount -lt $i_count; $initCount++ ) { 

       #Write-Host "$($data_files.Count) Files found in folder!"

       Write-Host   ($data_files[$initCount].name ) #display the filename with the extension

        Write-Output  ($data_files[$initCount].name ) >> d:\Files_list.txt # write data to a text file; ">>" append operator since for loop is used

 }

}else{

    Write-Host No files in the folder!
}

#=======================================

Change the script folder path to the desired location.

The…

Check setting for local group policies

Local group policies define policies for a particular windows system; Set restriction policies, such as limiting number of connection for a remote desktop and other numerous settings that can be set by the system administrator.
The local group policy has a lot of settings to configure and is quite tough to remember those settings unless you have an extraordinary super memory.
Keeping track of the changes in local group policy is important for troubleshooting purposes or if there are some issues that will arise due to policy change.
A proper documentation such as screenshots or other methods is necessary to ease the pain of why and how the problem started.
Windows provided an RSOP tool  to view the list of enabled configuration in group policy settings.
RSOP.msc (resultant set of policy) shows which policy is enabled on the system. So the System Admin can just set and forget which of course not a good practice. But if need to reconfigure but don't know which settings; then run the …

List all IP Addresses of a server

Multi-homed server, a server with multi-services and is set with different IPs is quite common if there is a budget constraint. It is always good to have a dedicated server do a single function provided there is enough luxury to do it.
So if you just inherited the network and all the servers in your environment have documentation which is poor to nothing, then pray hard that nothing will happen until you have it under control by proper documentation and familiarization.
It's quite tough to troubleshoot when a problem arises if no proper documentation to depend on and there will be a lot of surprises as the work journey goes on.
Listing or getting the IP Addresses on your entire server and having a proper documentation will definitely help and ease the tension during some issues.
It’s also easy to troubleshoot during a network outage or other circumstances that may arise.
Listing the IP Address of a server can be done in different ways.
Doing it remotely is quite convenient and of…

Download Windows 10 ISO

Image
Ever want to download the ISO file for Windows 10 but keeps getting an error.
To download Windows 10, click on the link below and on Microsoft Webpage scroll down and click on "Download tool now". Click "Using the media creation tool" on how to use this tool.
Link to download Media creation tool: https://www.microsoft.com/en-gb/software-download/windows10

Download the tool; once its downloaded the file name should be "Media Creation Tool".

ISO file is around 3GB so depending on your bandwidth it make take some time. If your bandwidth is not reliable use a browser that continue or resume the download, even though the connection was disconnected. Firefox supports this feature.
If the tool is executed at an elevated mode, you will receive an error like:

There was a problem running this tool
We're not sure what happened, but we're unable to run this tool on your PC. If you continue experiencing problems, reference the error code when contacting custome…

List online computers in an OU via PowerShell

PowerShell get folder security settings