tag:blogger.com,1999:blog-8229131257128040189.comments2023-04-11T11:36:03.057+01:00Think Big - with PowershellTompahttp://www.blogger.com/profile/00462564333522996562noreply@blogger.comBlogger115125tag:blogger.com,1999:blog-8229131257128040189.post-84872039672577646112019-02-05T12:20:34.297+00:002019-02-05T12:20:34.297+00:00this is because script incorrectly forms commands ...this is because script incorrectly forms commands for records under _msdcs.FQDN zone adding _msdcs to record. i.e. in this case records is in _msdcs.YLOPPE.MSOAAE.targ.NET zone and correct command is:<br />dnscmd co1ylpads002 /recorddelete _msdcs.YLOPPE.MSOAAE.targ.NET _kerberos._tcp.CO1._sites.dc SRV 0 100 88 co1ylpadds004.yloppe.msoaae.targ.net<br /><br />if deleting hundreds of records nice to add /f too else you are asked Yes/No for each record.<br /><br />Anyway good script, saved me tons of time. Thanks.DariusLhttps://www.blogger.com/profile/16779940328346753804noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-33954602328874174812018-11-08T08:55:03.956+00:002018-11-08T08:55:03.956+00:00Nice post, tnxNice post, tnxAnonymoushttps://www.blogger.com/profile/06220686357747492923noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-36943882215865391112018-09-21T14:35:06.161+01:002018-09-21T14:35:06.161+01:00While a nice article, using the alias % when you a...While a nice article, using the alias % when you are trying to show others how to do something is a terrible idea. <br />*Especially* when you also use % to mean something else in the same line.<br />You should really try to always write out the full command (ForEach-Object in this case) when writing something you want others to look at.Anonymoushttps://www.blogger.com/profile/16429083422956872722noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-28517537236603639382018-07-17T17:51:25.602+01:002018-07-17T17:51:25.602+01:00Thanks for this post. It'll certainly help me....Thanks for this post. It'll certainly help me.<br /><br />Br,Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-34006540877526505142018-07-12T13:26:25.620+01:002018-07-12T13:26:25.620+01:00here is an sql query that direcly queries the hotf...here is an sql query that direcly queries the hotfixes and related hostnames from SCCM database<br />https://bestitsm.wordpress.com/2018/07/12/how-to-get-list-of-installed-hotfixes-from-sccm-database/Anonymoushttps://www.blogger.com/profile/13916651291447349542noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-48783696739457996522018-02-05T19:37:20.553+00:002018-02-05T19:37:20.553+00:00What command can i run to put the output to a .csv...What command can i run to put the output to a .csv fileAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-17876657370889862772018-01-24T17:05:59.228+00:002018-01-24T17:05:59.228+00:00Good stuff.. Now just need to expand it to email a...Good stuff.. Now just need to expand it to email and also tell us when the next scavenging cycle will run.. I'll work on that and post back if I figure it out..Tom S.https://www.blogger.com/profile/17406744774732876748noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-44292531097055646692017-11-10T22:25:40.885+00:002017-11-10T22:25:40.885+00:00Heya i am for the first time here. I found this bo...Heya i am for the first time here. I found this board and I in finding <br />It truly helpful & it helped me out much.<br />I am hoping to give one thing again and aid others such as you helped me.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-12178875411288584742017-11-05T20:52:15.187+00:002017-11-05T20:52:15.187+00:00yes, in the example it is, but it can be separated...yes, in the example it is, but it can be separated if needed, just make sure you have the right level of access to the DNS servers (or the DCs if they are the ones running the zone.)Tompahttps://www.blogger.com/profile/00462564333522996562noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-79510538073097796862017-10-09T13:52:10.531+01:002017-10-09T13:52:10.531+01:00IS domain the same as dnszone? IS domain the same as dnszone? Snoopy75https://www.blogger.com/profile/06882039162277680232noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-55199570802252392192017-10-09T13:49:45.471+01:002017-10-09T13:49:45.471+01:00is domain the same as dnszone? I do not get any ou...is domain the same as dnszone? I do not get any output from my other zonesSnoopy75https://www.blogger.com/profile/06882039162277680232noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-87526593266052741922017-10-09T13:49:42.184+01:002017-10-09T13:49:42.184+01:00is domain the same as dnszone? I do not get any ou...is domain the same as dnszone? I do not get any output from my other zonesSnoopy75https://www.blogger.com/profile/06882039162277680232noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-87456422191625342292017-10-09T13:49:36.927+01:002017-10-09T13:49:36.927+01:00is domain the same as dnszone? I do not get any ou...is domain the same as dnszone? I do not get any output from my other zonesSnoopy75https://www.blogger.com/profile/06882039162277680232noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-41469375699834932852017-08-16T07:41:58.843+01:002017-08-16T07:41:58.843+01:00Nice Blog Post !Nice Blog Post !Used PC Exporterhttp://www.electrocw.com/noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-73266267324853448072017-04-11T14:29:25.585+01:002017-04-11T14:29:25.585+01:00Glad it was useful, Master JediGlad it was useful, Master JediTompahttps://www.blogger.com/profile/00462564333522996562noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-82252876540006772292017-04-11T14:21:57.229+01:002017-04-11T14:21:57.229+01:00you can just use the GetHostByName method, e.g.:
P...you can just use the GetHostByName method, e.g.:<br />PS C:\Users\tompa> [System.Net.Dns]::getHostByName("r2d2srv.tatooine.com")<br />Tompahttps://www.blogger.com/profile/00462564333522996562noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-77795053663634356762017-04-11T14:13:48.729+01:002017-04-11T14:13:48.729+01:00well done on finding this bug :) thanks!well done on finding this bug :) thanks!Tompahttps://www.blogger.com/profile/00462564333522996562noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-81924615638032431222017-04-11T14:13:30.504+01:002017-04-11T14:13:30.504+01:00good catch!good catch!Tompahttps://www.blogger.com/profile/00462564333522996562noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-24607209036876049142017-04-11T02:10:54.632+01:002017-04-11T02:10:54.632+01:00Nice one! Nice one! Levihttps://www.blogger.com/profile/04562801758997612435noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-23721261050920134682017-03-10T14:28:30.241+00:002017-03-10T14:28:30.241+00:00I resolved my missing Hostname with this code:
# ...I resolved my missing Hostname with this code:<br /><br /># get the list of Windows DNS servers from the pipe <br /> $hostlist = @($Input) <br /> $hostlist = [system.directoryservices.activedirectory.domain]::GetCurrentDomain() | ForEach-Object {$_.DomainControllers} | ForEach-Object {$_.Name} <br /># $hostlist = Get-Content $scriptFile<br /><br />$hostlistlength = ($hostlist | measure).count<br /> <br /> # go through each host <br /> foreach($srv in $hostlist){ <br /> $sObject = "" | select hostname,ScavengingInterval,LastScav,DefaultAgingState <br /> <br /> # run dnscmd to get the detailed info of each DNS server <br /> dnscmd $srv /info | %{ <br /> $value = $null <br /> <br /> # pick out the data from dnscmd output with regex matches <br /> if($_ -imatch "server name"){ <br /> $value = ([regex]::Match($_, "= .+$")).value -replace "= ","" <br /> $sObject.hostname = $value <br /> $value = $null <br /> } <br /> elseif($_ -imatch "last scav"){ <br /> $value = ([regex]::Match($_, "= .+$")).value -replace "= ","" <br /> $sObject.LastScav = $value <br /> $value = $null <br /> } <br /> elseif($_ -imatch "ScavengingInterval"){ <br /> $value = ([regex]::Match($_, "= .+$")).value -replace "= ","" <br /> $sObject.ScavengingInterval = $value <br /> $value = $null <br /> } <br /> elseif($_ -imatch "DefaultAgingState"){ <br /> $value = ([regex]::Match($_, "= .+$")).value -replace "= ","" <br /> $sObject.DefaultAgingState = $value <br /> $value = $null <br /> } <br /> } <br /> $sObject <br /> } Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-11292930657135024092017-03-09T15:58:38.064+00:002017-03-09T15:58:38.064+00:00Thanks for this. I didn't have to reinvent the...Thanks for this. I didn't have to reinvent the wheel. There is an small error in the code: $server should be $dnsServer, otherwise runs perfectly.Jason Shermanhttps://www.blogger.com/profile/09000877542308984992noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-4386059932065484902017-03-02T14:28:06.888+00:002017-03-02T14:28:06.888+00:00$dnsserver = "c3podc1" <- Correction... $dnsserver = "c3podc1" <- Correction - change the variable name so it matches the commandAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-70394939944272778742017-02-07T23:26:44.380+00:002017-02-07T23:26:44.380+00:00Hi,
How to get the ip addresses for the FQDN with...Hi,<br /><br />How to get the ip addresses for the FQDN with forward lookup ? so we can have a complete picture ?<br /><br />Thanks, Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-15060074823016152842017-02-04T07:40:24.754+00:002017-02-04T07:40:24.754+00:00if you have a list of collection names in a text f...if you have a list of collection names in a text file, e.g.:<br />collection1<br />collection2<br />collection3<br /><br />You can do it like this<br /><br />get-content c:\collectionlist.txt | %{addremovecollection.ps1 -collname $_}Tompahttps://www.blogger.com/profile/00462564333522996562noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-10043876944007010142017-01-05T12:42:35.012+00:002017-01-05T12:42:35.012+00:00Do we have the powershell script to delete the col...Do we have the powershell script to delete the collections in bulk from SCCM 2012.Anonymoushttps://www.blogger.com/profile/08553135780778067269noreply@blogger.com