Name: Windows Server®, ServerStandard edition
Description: Windows Operating System - Windows Server®, VOLUME_KMSCLIENT channel
Partial Product Key: R7VHC
License Status: Licensed
Volume activation expiration: 256440 minute(s) (178 day(s))
Key Management Service client information
Client Machine ID (CMID):
KMS machine name from DNS:
KMS machine extended PID:
Activation interval: 120 minutes
Renewal interval: 10080 minutes
KMS host caching is enabled
I tried editing an analysis I used in the past and it doesn’t get the results, false
(if (it as string as lowercase starts with “kms machine name from dns:”) then (it) else (substrings before “)” of (substrings after “(” of it))) of lines whose ((it as string as lowercase starts with “kms machine name from dns:”) OR (it as string as lowercase contains “kms machine name from dns:”)) of file “C:@oneneck\kms.txt”
So I tried to simplify it and still false
(it as string as lowercase contains “kms machine name from dns:”) of file “C:@oneneck\kms.txt”
This will get me t: and a random number
(it as string as lowercase contains “kms”) of file “C:@oneneck\kms.txt”
But this goes back to false
(it as string as lowercase contains “kms*”) of file “C:@oneneck\kms.txt”
What is the best way to get the string following "KMS machine name from DNS: "
But to illustrate, the root problem of your queries is that you are iterating over <file> when I think you intend lines of <file>
(it as string as lowercase contains “kms*”) of file “C:@oneneck\kms.txt
…is checking ‘file’, the default property of ‘file’ will give the file name, version, and a couple of metadata properties, so what you need is ‘lines of’ the file.
That analysis has everything I don’t want. I just want to know the server that it’s getting KMS from.
I tried this one earlier but it’s not working
string value of select “DiscoveredKeyManagementServiceMachineName from SoftwareLicensingProduct WHERE (PartialProductKey is not null) and (Name LIKE ‘Windows®%25’ or Name LIKE ‘Windows Server®%25’) and not (Name LIKE ‘%25ESU%25’)” of wmi
The fixlet exports what I want. I just need the analysis to pull the string for me.
This is failing. I don’t know why. You can see it doesn’t like the wildcard though. So I need it to work with a wildcard and I want the string not a true/false.
One more question. How do I get rid of the “KMS machine name from DNS” in the text and just return the results after? Guessing something with substring after?
OK, hopefully the last one I got. Microsoft changed the output of slmgr by OS. I need to make this if the first line exist then return that else do the next one.
So if this is true, return value
substring after ": " of lines whose (it as string as lowercase contains “kms machine name from dns:”) of file “C:@oneneck\kms.txt”
Else, return this one.
substring after ": " of lines whose (it as string as lowercase contains “registered kms machine name”) of file “C:@oneneck\kms.txt”
Ignore last one. Found one of Jason’s other post and copied. I was definitely over complicating it.
substring after ": " of lines whose (it as string as lowercase contains “kms machine name from dns:” OR it as string as lowercase contains “registered kms machine name” ) of file “C:@oneneck\kms.txt”
You could also add this as WMI query to whatever analysis you’re building.
unique values of string values of selects "DiscoveredKeyManagementServiceMachineName from SoftwareLicensingProduct WHERE (PartialProductKey is not null)" of wmi