Lapas

otrdiena, 2015. gada 26. maijs

Export/Import DHCP server reservations list

Run CMD as administrator on source server

c:\> netsh dhcp server \\MY_SERVER_NAME scope 192.168.1.0 dump>c:\dhcp.txt

Delete unnecessary commands, update "server name" and/or "scope"
Run CMD as administrator on destination server

c:\> netsh exec c:\dhcp.txt

otrdiena, 2015. gada 12. maijs

Recover deleted user from Office 365

Connect to MSOnline using powershell and run the code:

Restore-MsolUser -UserPrincipalName user1@o365info.com -AutoReconcileProxyConflicts -NewUserPrincipalName user1@o365info.com

Source: o365info.com

trešdiena, 2015. gada 22. aprīlis

Cannot insert new column in Excel

Error message: "To prevent possible loss of data, Microsoft Excel cannot shift nonblank cells off the worksheet."

Select first unnecessary column -  CTRL+Shift+Right - selects all columns till end.

Press separately magic combination ALT, E, A, A (Clear All content)

Source: wizardofexcel.com

pirmdiena, 2015. gada 30. marts

Bypass powershell security warning

To bypass security warning when running scripts from UNC path, just run powershell with -ExecutionPolicy argument

PowerShell -ExecutionPolicy Bypass -File \\server\share\filename.ps1

ceturtdiena, 2015. gada 5. marts

Change Windows numlock status

Logon screen:
[HKEY_USERS\.DEFAULT\Control Panel\Keyboard]
Set InitialKeyboardIndicators = 2

Current user:
[HKEY_CURRENT_USER\Control Panel\Keyboard]
Set InitialKeyboardIndicators = 2

trešdiena, 2015. gada 21. janvāris

Create custom password settings for AD users server 2012 R2

Start-> Run-> adsiedit.msc
Locate CN=System -> CN=Password Settings Container 
Create new Object:
In the Create Object dialog box, under Select a class, click msDS-PasswordSetting
Value, type the name of the new PSO

Example values:
msDS-PasswordSettingsPrecedence - 10
msDS-PasswordReversibleEncryptionEnabled - FALSE
msDS-PasswordHistoryLength - 5
msDS-PasswordComplexityEnabled - TRUE
msDS-MinimumPasswordLength - 8
msDS-MinimumPasswordAge - 1:00:00:00 (1 day)
msDS-MaximumPasswordAge - 60:00:00:00 (60 days)
msDS-LockoutThreshold - 10
msDS-LockoutObservationWindow - 0:00:60:00 (60 minutes)
msDS-LockoutDuration - 0:00:60:00 (60 minutes)
msDS-PSOAppliesTo - “CN=u1,CN=Users,DC=DC1,DC=contoso,DC=com”


To disable account lockout policies, assign the msDS-LockoutThreshold attribute the value of 0.

Source:  technet.microsoft.com

ceturtdiena, 2015. gada 15. janvāris

Configure AD NTP synchronization

Run command promt as administrator.
Check time before sync:
echo %time%

Configure local time servers:
w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:MANUAL

net stop w32time
net start w32time

Check time after sync:
echo %time%

Force resync:
w32tm /resync 

Check settings:
reg query HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
w32tm /query /source

Check status
w32tm /query /status

Change time zone:
Set-TimeZone -Name "FLE Standard Time"
or
tzutil /s "FLE Standard Time"