Lapas

otrdiena, 2016. gada 3. maijs

Reset windows security settings to default.

secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose

Rename folders: WinDir%\System32\GroupPolicyUsers and WinDir%\System32\GroupPolicy

Sourc: microsoft.com and sevenforums.com

trešdiena, 2016. gada 13. aprīlis

Use INDEX(MATCH()) instead of LOOKUP() in Excel

=INDEX ( Column I want a return value from , MATCH ( My Lookup Value , Column I want to Lookup against , Enter “0” ))

Source: www.randomwok.com

ceturtdiena, 2016. gada 7. aprīlis

Get server's all active users mapped disks and ports

Powershell script made by b.koehler:

function Get-MappedDrives($ComputerName){
  $output = @()
  if(Test-Connection -ComputerName $ComputerName -Count 1 -Quiet){
    $Hive = [long]$HIVE_HKU = 2147483651
    $sessions = Get-WmiObject -ComputerName $ComputerName -Class win32_process | ?{$_.name -eq "explorer.exe"}
    if($sessions){
      foreach($explorer in $sessions){
        $sid = ($explorer.GetOwnerSid()).sid
        $owner  = $explorer.GetOwner()
        $RegProv = get-WmiObject -List -Namespace "root\default" -ComputerName $ComputerName | Where-Object {$_.Name -eq "StdRegProv"}
        $DriveList = $RegProv.EnumKey($Hive, "$($sid)\Network")
        if($DriveList.sNames.count -gt 0){
          foreach($drive in $DriveList.sNames){
          $output += "$($drive)`t$(($RegProv.GetStringValue($Hive, "$($sid)\Network\$($drive)", "RemotePath")).sValue)`t$($owner.Domain)`t$($owner.user)`t$($ComputerName)"
          }
        }else{write-debug "No mapped drives on $($ComputerName)"}
      }
    }else{write-debug "explorer.exe not running on $($ComputerName)"}
  }else{write-debug "Can't connect to $($ComputerName)"}
  return $output
}

<#
#Enable if you want to see the write-debug messages
$DebugPreference = "Continue"

$list = "Server01", "Server02"
$report = $(foreach($ComputerName in $list){Get-MappedDrives $ComputerName}) | ConvertFrom-Csv -Delimiter `t -Header Drive, Path, Domain, User, Computer

$report | Out-GridView
#>


Source: technet.microsoft.com

pirmdiena, 2016. gada 4. aprīlis

Set default windows ip on server with multiple ip addresses

Run PowerShell.
Get interface name:
Get-NetAdapter

Set status "SkipAsSource":
Set-NetIPAddress –InterfaceAlias <Interface> –SkipAsSource $True

ceturtdiena, 2016. gada 11. februāris

Delete Offline Files Cache

 
  • Open Registry editor (Execute Regedit from Run window)
  • Go to this key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSe\Services\Csc\Parameters
  • If Parameters key does not exist under CSC you can add it.
  • Now in the Parameters node create a new registry value with the name FormatDatabase of type REG_DWORD (i.e DWord 32-bit value)
  • Set the data in this new registry value to 1.
  • Close registry editor
  • Reboot the machine
Source: technlg.net