Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Monday, 21 September 2015

Windows 10 search cannot find any applications

So since installing Windows 10, the search has been working fine.
Now today, When using search to find *any* application it doesn't find shit... seriously, it doesn't registere there are any applications.

Even though indexing is turned on for all the relevant places like c:\program files, c:\users, start menu it doesn't work.

The only thing that does work is a re-installation of Cortana

Firstly, open an elevated powershell prompt (see here if you don't know how) and run the following
Get-AppXPackage -Name Microsoft.Windows.Cortana | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

After that it instantly works.... very annoying or what?
 

Tuesday, 16 September 2014

List users on a terminal services server

qwinsta /server:servername1

 SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
 services                                    0  Disc
 console                                     1  Conn
                   bob5                      2  Disc
 rdp-tcp#1         bob4                      3  Active
                   bob3                      4  Disc
 rdp-tcp#4         bob2                      5  Active
 rdp-tcp#0         bob                       6  Active

Tuesday, 26 August 2014

List installed windows programs on a pc remotely via command line


install the sysinternals process tools from here

psexec \\COMPUTERNAME -u administrator -p password reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s | findstr /B ".*DisplayName"
 voila
Note, there are other methds to query via WMI, but this only works with MSI installed packages.
 

Monday, 12 August 2013

Accessing Windows 2012/2008 shares with sambaclient and NT_STATUS_LOGON_FAILURE

Ok
so we migrated from a Windows 2008 server to Windows 2012, and our automated build system hudson could no longer copy it's files over to the new server.

using smbclient to create a directory on the fileserver, didn't work after we migrated.

smbclient //server01.corp/dfs_shared/ -U username%password

The old file server could authenticate us, with both the hudson account and our domain admin accounts. The new file server couldn't.

we checked:
firewall rules (hardware)
firewall rules (windows)
local policy (Net lanman auto type -v1/v2)

Eventually,

I figured out this worked.

smbclient //server01.corp/dfs_shared/ -U domain\\username%password

The reason being that we were now authenticating against a file server ONLY. The previous server was also a domain controller (which has no concept of a local account). As the new server was a file server only, when it was authing, it was checking against it's local account, which obviously, doesn't exist.

Thursday, 14 February 2013

Using Check_mk to check the Disk queue length on a windows server



Add this script to your plugins (name it as diskqueue.ps1 for example). Standard location is C:\Program Files (x86)\Check_mk\plugins

#this check returns both the disk read queue lentgh and the disk write queue length
#for all logical disks on a server in the format:
#<drive letter> <read queue length> <write queue length>

#write check name to host
Write-Host "<<<windisk_queue>>>"

#get all of the drive letters (DeviceID) of all local (DriveType 3) logical disks from wmi
$driveletters = Get-WmiObject win32_logicaldisk -Filter "DriveType='3'" | Select -ExpandProperty "DeviceID"

#get the current value for the disk read and disk write queue length and format to 2 decimal places
ForEach($driveletter In $driveletters){

$diskreadqueuelength = "{0:N2}" -f ((Get-Counter -Counter "\LogicalDisk($driveletter)\Avg. Disk Read Queue Length").countersamples | Select -ExpandProperty "CookedValue")
$diskwritequeuelength = "{0:N2}" -f ((Get-Counter -Counter "\LogicalDisk($driveletter)\Avg. Disk Write Queue Length").countersamples | Select -ExpandProperty "CookedValue")

Write-Host $driveletter $diskreadqueuelength $diskwritequeuelength

}


then add this to your /usr/share/check_mk/checks folder with the same name as the check windisk_queue

#!/bin/python

inventory_process = []
inventory_process_active = []

# the inventory version (dummy)

def inventory_windisk_queue(checkname, info):
    # begin with empty inventory
    inventory = []
    #   print checkname
    for line in info:
        drive = str(line[0])
        read = line[1]
        write = line[2]
        inventory.append ((  "%s" % drive, (read, write)  ))
        #inventory
    return inventory
 
#the actual check
def check_windisk_queue (item, params, info):
    #print item
    #print params
    print info[0][0]
    perfdata = params
    drive = str(info[0][0])
    read = info[0][1]
    write = info[0][2]

    performance =[ ( "Read", read), ("Write", write)]
    return ((0, "No checks implemented - ONLY FOR PERFORMANCE. Read %s, Write %s" % (read, write), performance ))


# checking function, service description, perf data, invenotry function
check_info['windisk_queue'] = (check_windisk_queue, "Disk Q Length",1 ,inventory_windisk_queue)

reinventory with cmk -uII
tada!

Thanks to JJ Clements for the powershell script