tag:blogger.com,1999:blog-50181589981816626602024-03-05T18:54:22.374-03:00Sysadmin WorldSome sysadmin tricks and other stuff
あなたUnknownnoreply@blogger.comBlogger42125tag:blogger.com,1999:blog-5018158998181662660.post-17925657148219669792019-06-15T10:37:00.000-03:002019-06-15T10:41:44.239-03:00Robocopy only ACLs from source to target <br />
set source=source<br />
set target=target<br />
robocopy %source% %target% /SECFIX /E /XX /COPY:ASOU /mt:128 /r:0 /w:0 /np /X /V /LOG+:ROBOLOG.TXT<br />
<br />
To only copy ACLs from source to Target<br />
Not modifying the data (data will remain intact)<br />
<b>AVOID /SEC</b> :: copy files with SECurity (equivalent to /COPY:<b>D</b>ATS). -> INCLUDES D<br />
/COPY:ASOU<br />
/XX :: eXclude eXtra files and directories.<br />
/MT[:n] :: Do multi-threaded copies with n threads (default 8). (must be Win x64 2008 R2 or newerish)<br />
/r:0 /w:0 - wait 0 when error, retry 0 on error<br />
/NP :: No Progress - don't display percentage copied. (fastens the copy in theory)<br />
/X :: report all eXtra files, not just those selected.<br />
/V :: produce Verbose output, showing skipped files.<br />
/LOG+:file :: output status to LOG file (append to existing log). (could also be /UNILOG+:file :: output status to LOG file as UNICODE (append to existing log).<br />
<br />
/E :: copy subdirectories, including Empty ones.<br />
/SECFIX :: FIX file SECurity on all files, even skipped files. (enforce matching or equal file -compared source vs target - to be processed)<br />
<br />
/COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT).<br />
(copyflags : D=Data, A=Attributes, T=Timestamps).<br />
(S=Security=NTFS ACLs, O=Owner info, U=aUditing info).<br />
<br />
If required add the backup mode (SEbackupPrivilege/SErestorePrivilege)<br />
/B :: copy files in Backup mode.<br />
<br />
<b>ALWAYS TEST FIRST </b><br />
<b>SEE THE RESULTS THEN APPLY WHERE YOU NEED</b><br />
<b><br /></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZuqRuA6GqKok24100nVg_nskGpOGVPEFscBoDW8ADYW03weJ_BrgRB_xFeQD1zFYnFM0zQBafJ_YabwJgcCrzbrmK3Cs2wWbthcaCsBNdM2c74-Z4ZK33Yr_pIYCTKZiHzluVCU5dbU1m/s1600/willy.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="902" data-original-width="1600" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZuqRuA6GqKok24100nVg_nskGpOGVPEFscBoDW8ADYW03weJ_BrgRB_xFeQD1zFYnFM0zQBafJ_YabwJgcCrzbrmK3Cs2wWbthcaCsBNdM2c74-Z4ZK33Yr_pIYCTKZiHzluVCU5dbU1m/s320/willy.jpg" width="320" /></a></div>
<b><br /></b>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-33087806186339916862017-07-28T21:03:00.002-03:002017-07-28T21:04:41.396-03:00 Powershell List folder content, search by criteria, list files, delete, check existence, report=========================================<br />
$ErrorActionPreference = "SilentlyContinue";<br />
Stop-Transcript | out-null<br />
$Archivolog = "C:\temp\output-$(get-date -f yyyy-MM-dd_hh-mm-ss).txt"<br />
$Archivolog2 = "C:\temp\compress-logfiles-$(get-date -f yyyy-MM-dd_hh-mm-ss).txt"<br />
Start-Transcript -path $Archivolog -append<br />
$criteria = Minidump*.dmp<br />
Write-Host Step Delete MINIDUMP FILEs Start at $(get-date)<br />
$mindump = gci c:\test1 -recurse -Include "$criteria"<br />
if ($mindump -eq $null) {write-host *** No files found to delete ***} else {write-host List of files to delete:; $mindump | % {write-host $_}}<br />
remove-item $mindump -force<br />
$mindump | % {If(test-path $_){ write-host $_";File NOT DELETED"} else {write-host $_";File DELETED"}}<br />
<br />
Write-Host Step Delete MINIDUMP FILEs Finished at $(get-date)<br />
Stop-Transcript<br />
$text = [IO.File]::ReadAllText($Archivolog)<br />
New-EventLog –LogName Application –Source "Nakama test"<br />
Write-EventLog –LogName Application –Source "Nakama test" –EntryType Information –EventID 9213 –Message $text<br />
=========================================Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-33916371302588771202017-07-26T19:27:00.002-03:002017-07-26T19:27:50.036-03:00Do something and Log information to event log in PowershellA quick way to generate a log file that can be used to feed write-eventlog<br />
=========================================<br />
$ErrorActionPreference="SilentlyContinue"<br />
Stop-Transcript | out-null<br />
$ErrorActionPreference = "Continue"<br />
$Archivolog = "C:\temp\output-$(get-date -f yyyy-MM-dd_hh-mm-ss).txt"<br />
$Archivolog2 = "C:\temp\compress-$(get-date -f yyyy-MM-dd_hh-mm-ss).txt"<br />
Start-Transcript -path $Archivolog -append<br />
Write-Host Step 1 Start at $(get-date)<br />
gci -r C:\temp | where {$_.attributes -notmatch "compressed"} | foreach {compact /C $_.fullname } | out-file $Archivolog2 -Append<br />
gc $Archivolog2<br />
Write-Host Step 1 Finished at $(get-date)<br />
Stop-Transcript<br />
$text = [IO.File]::ReadAllText($Archivolog)<br />
New-EventLog –LogName Application –Source "Nakama test"<br />
Write-EventLog –LogName Application –Source "Nakama test" –EntryType Information –EventID 9213 –Message $text<br />
=========================================Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-89756119630925307562017-02-12T23:46:00.002-03:002017-02-12T23:46:53.000-03:00Parse ACLs and comparison made between 2 files obtained through setacl.exe command======================================================<br />
copy wealth_source.csv source.csv /y<br />
copy wealth_target.csv target.csv /y<br />
<br />
sed -ie "/^\\\\/{n;d}" source.csv<br />
sed -ie "s/ /;/g" source.csv<br />
awk -F; "{if (NF!=0 && $1==\"\") {$1=prev} prev=$1}1" OFS=; source.csv >source2.csv<br />
sed -i "/^\s*$/d" source2.csv<br />
sed -ie "s/=/;/g" source2.csv<br />
sed -ie "/.*;DACL/d" source2.csv<br />
<br />
<br />
awk -F";" "BEGIN {OFS=\";\"} {gsub(/\\/,\";\",$2); print}" source2.csv >source3.csv<br />
awk -F";" "BEGIN {OFS=\";\"} {print $0, $1\"\\\\\" $3}" source3.csv >source4.csv<br />
<br />
sed -ie "/^\\\\/{n;d}" target.csv<br />
sed -ie "s/ /;/g" target.csv<br />
awk -F; "{if (NF!=0 && $1==\"\") {$1=prev} prev=$1}1" OFS=; target.csv >target2.csv<br />
sed -i "/^\s*$/d" target2.csv<br />
sed -ie "s/=/;/g" target2.csv<br />
sed -ie "/.*;DACL/d" target2.csv<br />
del sed *.<br />
<br />
awk -F";" "BEGIN {OFS=\";\"} {gsub(/\\/,\";\",$2); print}" target2.csv >target3.csv<br />
awk -F";" "BEGIN {OFS=\";\"} {print $0, $1\"\\\\\" $3}" target3.csv >target4.csv<br />
<br />
<br />
awk -F";" "BEGIN {OFS=\";\"} {print $08, $0}" target4.csv >target5.csv<br />
awk -F";" "BEGIN {OFS=\";\"} {print $08, $0}" source4.csv >source5.csv<br />
awk -F";" "BEGIN {OFS=\";\"} {gsub(/\\\\TargetServer\\software/,\"\",$1); print}" target5.csv >target6.csv<br />
awk -F";" "BEGIN {OFS=\";\"} {gsub(/\\\\OriginalServer\\Vol1/,\"\",$1); print}" source5.csv >source6.csv<br />
<br />
sed -i "/^;/d" target6.csv<br />
sed -i "/^;/d" source6.csv<br />
<br />
awk -F";" "NR==FNR{a[$1]=$1\";\"$2\";\"$3\";\"$4\";\"$5\";\"$6\";\"$7\";\"$8;next}{if (a[$1])print a[$1]\";\"$0;else print $1 \" Not Found\"\";\"\";\"\";\"\";\"\";\"\";\"\";\"\";\" $0;}" target6.csv source6.csv > BUSCA-EN-TARGET-LO-QUE-HAY-EN-SOURCE.CSV<br />
<br />
awk -F";" "NR==FNR{a[$1]=$1\";\"$2\";\"$3\";\"$4\";\"$5\";\"$6\";\"$7\";\"$8;next}{if (a[$1])print a[$1]\";\"$0;else print $1 \" Not Found\"\";\"\";\"\";\"\";\"\";\"\";\"\";\"\";\" $0;}" source6.csv target6.csv > Found-on-target.csv<br />
sed -i "1 i\Value searched;File found on Target (Targetserver);Target Domain found;Target Group found;Target SID found;Target ACL found;Target ACL found;Target ACL found;Source value;Source file;Source Domain;Source group;Source SID;Source ACL;Source ACL;Source ACL" BUSCA-EN-TARGET-LO-QUE-HAY-EN-SOURCE.CSV<br />
<br />
findstr /c:" Not Found" Found-on-target.csv >only-missings-on-source.csv<br />
<br />
del sed *.<br />
======================================================<br />
<br />
Script on Windows with awk/sed to parse two files making a comparison between them.<br />Scenario: robocopied source to target<br />ReACL is required. Tool used: setacl.exe with mapping.csv file using OLDSID,NEWSID<br />
This script removes what I don't care - Searches based on column or field 1: file/folder+GroupName, if not found it states not found.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-23672886342376333422017-02-12T22:37:00.001-03:002017-02-12T22:37:46.681-03:00AWK vlookup on Windows in my caseI needed to process two files/sheets to find the matches or mark un-match as Not found or anything similar.<br />
These are extremely long files which causes excel to take forever, or even crash everytime I ran a vlookup between these two sheets.<br />
<br />
awk vlookup solution would be something like this<br />
Assuming you have 2 files separated by semicolon as the demiliter.<br />
<br />
awk -F";" "NR==FNR{a[$1]=$1\";\"$2\";\"$3\";\"$4\";\"$5\";\"$6\";\"$7\";\"$8;next}{if (a[$1])print a[$1]\";\"$0;else print $1 \" Not Found\"\";\"\";\"\";\"\";\"\";\"\";\"\";\"\";\" $0;}" target6.csv source6.csv > BUSCA-EN-TARGET-LO-QUE-HAY-EN-SOURCE.CSV<br />
<br />
If first column of both files are equal, print columns 1 to 8 from the target6.csv file, plus the entire line from source6.csv if it is not found it will print the value we are looking plus "Not found" and then the entire line from source6.csv<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-58356264765508012542016-02-07T20:39:00.000-03:002016-02-07T21:19:34.180-03:00SRT to VobSubI bought a TV: Panasonic ET60 very nice but it does not handle subtitles very well, or I mean it is very limited (very small font, and not possible to change colors)<br />
<br />
The solution would be to either hard copy the subtitles or use vobsub subtitles (idx+sub / vobsub is supported on this TV, I guess many DVD players and other Smart TV would be in the same conditions).<br />
<br />
So I found two good solutions txt2vobsub or subtitlecreator.<br />
I prefer subtitlecreator because the fonts look slightly better, but maybe that just me.<br />
And finally use mkvmerge (incredible tool) to pack all together.<br />
<br />
So I created two scripts, one for each case, you would need to download/extract and add that directory to your path (System environment) or you could copy all the files everytime.<br />
Then copy for each case the .cmd to the directory where you have the movie and subtitle.<br />
The script will look for .mp4 and .srt (same filename). You could edit or rename based on your preference.<br />
<br />
(if you want to modify the font and size: for txt2vobsub just edit the batch fule and replace the name, I think it is set to Arial 24, if you want do this for SubCreator go to the data subfolder, edit the profile.xml, edit colors by changing the palette colors in hex format, this will also let you position the subtitle as required, with these settings it will work for 720p movies in general).<br />
<br />
Download link: <a href="https://mega.nz/#F!GdsFAIJZ!PYvbKNfWL_ZpVEfTJogn2w"><span class="file-link-info url" style="background-color: white; color: #333333; font-family: "source_sans_proregular" , "arial"; font-size: 13px; line-height: 30px; outline: none; resize: none;">https://mega.nz/#F!GdsFAIJZ</span><span class="file-link-info key" style="background-color: white; color: #d90007; font-family: "source_sans_proregular" , "arial"; font-size: 13px; line-height: 30px; outline: none; resize: none;">!PYvbKNfWL_ZpVEfTJogn2w</span></a><br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-77154818560280854202015-05-06T17:04:00.000-03:002015-05-06T17:04:25.525-03:00Add the filename to each start of line on a file with SEDSo you have a text file where you want to add the filename on each start of line for some reason so it can be easily managed as a csv or on Excel.<br />
<br />
So do a dir /b > on the directory or create a list of files that require the filename as the begining of each line on those files:<br />
<br />In my example I have a bunch of file names inside asd.txt<br /><br />for /f "tokens=*" %%i in (asd.txt) do sed "s/^/%%i;/" %%i<br />
<br />
or<br />
<br />
for /f "tokens=*" %%i in (asd.txt) do sed -i "s/^/%%i;/" %%i<br /><br />That will add the filename and a semicolon<br />
<br />Such as:<br />
file1;line1<br />
file1;line2<br /><br />And so on.<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-49807481694142937742015-04-23T16:02:00.002-03:002015-04-23T16:02:32.068-03:00Findstr regexp to find subfolders of shares 3rd levelFindstr regexp quick note:<br />
As you may know regexp or regular expressions are there to ease our work<br />
Using awk,sed is very common. But it can also be used to quickly search some patterns in windows native command findstr.<br />
If you are not familiar with regexp it is like telling your computer you want to search some patterns instead of a literal search.<br />
Literal search would be: dir file.txt : file.txt is the filename<br />
Regexp search would be: dir *.txt : the asterisk is part of the regexp search, it is a very silly simple example but you understand the idea.<br />
<br />
So for example you have a list of directories or shares.<br />
And what you need is to find only the subfolders, at the 3rd level.<br />
You can you use findstr in this way:<br />
type shares-with-quotes.txt | findstr /r /c:"\\\\.*\\.*\\.*"<br />
<br />
From input:<br />
\\server1\share1<br />
\\server2\share2<br />
\\server1\share1\subfolder1<br />
\\server2\share2\subfolder1<br />
<br />
type shares-with-quotes.txt | findstr /r /c:"\\\\.*\\.*\\.*"<br />
Only this will be filtered:<br />
\\server1\share1\subfolder1<br />
\\server2\share2\subfolder1<br />
<br />
And if you want the opposite do somethink like:<br />
type shares-with-quotes.txt | findstr /r /v /c:"\\\\.*\\.*\\.*"<br />
\\server1\share1<br />
\\server2\share2<br />
<br />
Note: "\" has to be doubled because of the regexp notation so a literal "\" needs to be stated as "\\", you will have to escape some special characters like this or dot, asteriks, etcUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-42759389539217891812015-02-24T19:11:00.001-03:002015-02-24T19:11:46.496-03:00AWK remove last Carriage ReturnWhen you are manipulating text sometimes you may want to go back to the last line which had text:<br />
So the next line will delete any carriage return until it reaches text:<br />
<br />
awk "BEGIN{ORS=\"\"}{print n $0}!n{n=\"\n\"}" asd.txtUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-87741125186638599212015-01-26T20:55:00.001-03:002015-01-26T20:55:51.018-03:00Network settings: only want to change a DNS server ip address on a client computer Remotely / No interface or NIC name is requiredSo a Domain Controller/DNS server went down and the plan was to actually retire that server anyways.<br /><br />We wanted to change the DNS Setting very fast. (replace the primary dns server on a large number of servers with another ip address).<br />I found this very nice <a href="http://jimmytheswede.blogspot.com.ar/2009/07/change-dns-on-multiple-computers.html">script</a> and decided to ran this as a test on a few servers, but from 96 machines it worked on 48 only (apparently the ping function did not work very well on some of our servers).<br />So I asked my coworker Seba Bistakis to create a similar VBS script.<br />
<br />Now we also wanted to avoid potential issues like a server down, or wmi not responding, access denied. So I created a so called "wmiPing" script in batch:<br />You will need Unix/Linux sed port which you can locate on some previous posts or any port on Internet, but this is only to extract those that failed.<br />
======================================================================<br />
for /f %%i in (lista.txt) do wmic /node:%%i os get | find /i "Windows" || echo %%i>>Falla.txt<br />
copy lista.txt refiltrado.txt /y<br />
for /f %%i in (Falla.txt) do sed -i "/%%i/Id" refiltrado.txt<br />
del sed*.<br />
======================================================================<br />
(if you prefer to remove them manually you can just remove the last loop to run sed).<br />
So the file refiltrado.txt is the one which we know wmi is working, we will use the content of that file.<br />
<br />
And my coworker created a script to be ran locally, which I modified a little bit to be run remotely,<br />
dns_change.vbs:<br />
======================================================================<br />
'Author(s): Seba Bistakis & Edu Nakama<br />
Set objShell = WScript.CreateObject("WScript.Shell")<br />
strFilename = "lista.txt"<br />
Set objFSO = CreateObject("Scripting.FileSystemObject")<br />
Set objTS = objFSO.OpenTextFile(strFilename)<br />
Set objFSO2 = CreateObject("Scripting.FileSystemObject")<br />
outFile = "lista1-executed.txt"<br />
objFSO2.DeleteFile(outFile)<br />
Set objFile = objFSO2.CreateTextFile(outFile,ForAppending,True)<br />
<br />
Do Until objTS.AtEndOfStream<br />
<br />
On Error Resume Next<br />
<br />
strComputer = objTS.ReadLine<br />
<br />
wscript.echo "============================"<br />
<br />
Set objWMIService = GetObject("winmgmts:" _<br />
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")<br />
<br />
If Err Then<br />
wscript.echo strComputer & ";Error;" & err.number & ";"<br />
Set objWMIService = Nothing<br />
End If<br />
On Error Goto 0<br />
<br />
If Not objWMIService Is Nothing Then<br />
objFile.Writeline strComputer<br />
Set colNicConfigs = objWMIService.ExecQuery _<br />
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")<br />
For Each objNicConfig In colNicConfigs<br />
If Not IsNull(objNicConfig.DNSServerSearchOrder) Then<br />
dns = objNicConfig.DNSServerSearchOrder<br />
For i = 0 To UBound(dns)<br />
wscript.echo strComputer & ";DNS" & i+1 & ";" & dns(i) & ";"<br />
If dns(i) = "10.261.40.23" Then<br />
dns(i) = "10.261.171.25"<br />
wscript.echo strComputer & ";DNS" & i+1 & ";" & dns(i) & ";CHANGED;"<br />
End If<br />
Next<br />
objNicConfig.SetDNSServerSearchOrder(dns)<br />
End If<br />
Next<br />
End If<br />
<br />
Loop<br />
objFile.Close<br />
objTS.Close<br />
======================================================================<br />As you can see you will need to enter a each server on after another (one each line) on a filed called "lista.txt"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6bVTeNlrHaSv-xPJ6QHIyaR8INXXgH1ppaGHCnTHT4f3zD2cfMjj5NQtxeI91kVodXAvsrl9aW490mNmy_DoIIJiORk4wNQZ7lF6BD7NLDIm-e8LZeJm2kP3akFehEqDQCqfSL2FPUhkb/s1600/dns.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6bVTeNlrHaSv-xPJ6QHIyaR8INXXgH1ppaGHCnTHT4f3zD2cfMjj5NQtxeI91kVodXAvsrl9aW490mNmy_DoIIJiORk4wNQZ7lF6BD7NLDIm-e8LZeJm2kP3akFehEqDQCqfSL2FPUhkb/s1600/dns.png" height="179" width="320" /></a></div>
Run the script as cscript dns_change.vbs > Results.csv<br /><br />Result.csv is the direct output of the script. As it is formated in CSV it can be opened on excel.<br />Lista1-executed.txt is a list of servers where the script was able to run on. If one is missing is because it couldn't ran on it.<br />
<br />Worked on: Windows 2003, Windows 2008, Windows 2012 servers.<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-71392932326281243172014-12-18T15:53:00.000-03:002014-12-18T16:01:57.020-03:00Remotely obtain or get the Dell Openmanage Server Administrator, OMSA versionThere are two different things<br />
One is the OMSA version, and the other is the server administrator version (agent version) of the web at port 1311.<br />
<br />
In most cases you would be looking for the OMSA version I guess.<br />
Best method would be using powershell:<br />
<br />
dellwmi.ps1<br />
==============================<br />
#Set variables<br />
$elserv = $args[0]<br />
$filename = $args[1]<br />
$elpath = $args[2]<br />
get-wmiobject Dell_SoftwareFeature -namespace root\cimv2\dell -computername $elserv | select-object __Server, AgentVersion, Version | export-csv "$filename"<br />
<div>
==============================</div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXkumtavHKqpHd9kG_AcMfmka1BxN7V0bTuTOtA2ezNlUMkAoy6R_gF3IAXpbO8gF7bgKUYg9V8kPaWi2ZtCRxq8_gVToFmFuPlt-ANTEM2lKj3CDofq1wMmXEqHA8aSGs69msn4yEf40l/s1600/omsa.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXkumtavHKqpHd9kG_AcMfmka1BxN7V0bTuTOtA2ezNlUMkAoy6R_gF3IAXpbO8gF7bgKUYg9V8kPaWi2ZtCRxq8_gVToFmFuPlt-ANTEM2lKj3CDofq1wMmXEqHA8aSGs69msn4yEf40l/s1600/omsa.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Script Output</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<br />
An alternative:<br />
As per:<br />
http://en.community.dell.com/dell-groups/dell-management-console/m/dell_management_console-mediagallery/19484157<br />
We know:<br />
Getting OMSA Version (OID .1.3.6.1.4.1.674.10892.1.100.2.0)....<br />
Success! Value received: 5.6.0<br />
Alternatively you can do a snmpwalk of (OID .1.3.6.1.4.1.674) to Dell's reserved OID.<br />
<br />
Through SNMP and uinsg a script for example:<br />
for /f %%i in (lista.txt) do (<br />
echo %%i;>> %%i.csv<br />
snmputil get %%i public .1.3.6.1.4.1.674.10892.1.100.2.0>> %%i.csv<br />
sed -i ":a;N;$!ba;s/\n//g" %%i.csv<br />
del sed*.<br />
)<br />
<br />
Search installed Product:<br />
for /f %%i in (lista.txt) do wmic /node:%%i product get caption,version /format:csv >>%%i.csv<br />
It didn't really worked for me because I only obtained the version on a few servers with this method 187 of 540 approximately.<br />
<br />
Last but not least:<br />
download sed, wget and grep ports for windows.<br />
==========================================<br />
for /f %%i in (lista.txt) do wget --tries 1 --no-check-certificate -r https://%%i:1311/servlet/UOMSAAbout<br />
for /f %%i in (lista.txt) do wget --tries 1 --no-check-certificate -r https://%%i:1311/UOMSAAbout<br />
<div>
<br /></div>
set ahora=%cd%<br />
for /f %%i in (lista.txt) do (<br />
echo %%i| sed "s/+1311//g" >%%i.txt<br />
cd /d %ahora%<br />
if exist "%%i+1311\servlet" cd "%%i\servlet+1311"<br />
if not exist "%%i+1311\servlet" cd "%%i+1311"<br />
grep -r -i "version" . | grep -i "OpenManage" >>%ahora%\%%i.txt<br />
cd /d %ahora%<br />
)<br />
<div>
==========================================</div>
You will need to remove strings that you don't need but the output would look like:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCzxlx-u1TPCSJHEdWZwDoylixsrnmWopi8Mofj4LxYbKPa339pqU5E3-687CLvy9NG5zrSQOi3hX4rbHZjJSqwCx76MKh2zq-lFYDI7X2TnDJV1k49TF52PWvsKlj3Fd5CO3mxzFLLRiW/s1600/omsa2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCzxlx-u1TPCSJHEdWZwDoylixsrnmWopi8Mofj4LxYbKPa339pqU5E3-687CLvy9NG5zrSQOi3hX4rbHZjJSqwCx76MKh2zq-lFYDI7X2TnDJV1k49TF52PWvsKlj3Fd5CO3mxzFLLRiW/s1600/omsa2.png" /></a></div>
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-36665649782225561682014-11-29T03:05:00.000-03:002014-11-29T03:05:47.193-03:00Merge multiple lines into one based on the first field: AWK on Windows When parsing text file, on some occasion you may need to merge different lines based on a field, in this example we will use the first field,column as the pattern or key. You can run:<br />
<br />
sort input.txt | awk -F";" "NR!=1 && p1!=$1{print anterior;anterior=\"\"}{p1=$1;anterior=(anterior\"\")?anterior FS substr($0,index($0,$2)):$0}END{if(anterior\"\") print anterior}"<br />
<br />
Assuming we have the next text file:<br />
input.txt<br />
F1;String1;String2;String3;String4<br />
F1;String5;String6;String7;String8<br />
F2;Text1;Text2;Text3;Text4;Text5;Text6<br />
F2;Somethingelse<br />
F1;Anotherthing<br />
F2;Anotherone<br />
<br />
In this example we want to merge lines based on the First Field of each line.<br />
But we need to sort it first so it F1 and F2 lines are consecutive.<br />
<br />
<br />
If your text is separated by a different character than semicolon separator replace -F";" by your separator or string. for example -F"," for a comma separated string.<br />
It is case sensitive, if want it to be case insensitive add IGNORECASE = 1 but will not work well on some cases, if you need insenstivie case it would be better to up case or lower case all the text.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKqz_ywp3zksge8Emr4lHffCzFS0XwssimkUWH8Bp95vYLCG13zJzFBWiIR5F-B6C71E4i_zR2wHNCjrhUEZYZxPesi_LRlMmFTik_Vqr2Busk7jLLafaVLfkY1uh5cDlKB32YLibBwb3o/s1600/mergelines.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKqz_ywp3zksge8Emr4lHffCzFS0XwssimkUWH8Bp95vYLCG13zJzFBWiIR5F-B6C71E4i_zR2wHNCjrhUEZYZxPesi_LRlMmFTik_Vqr2Busk7jLLafaVLfkY1uh5cDlKB32YLibBwb3o/s1600/mergelines.png" height="108" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Example of merging lines based on first field, semicolon separated text</td></tr>
</tbody></table>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-5872414023265709452014-11-26T20:47:00.000-03:002014-11-26T20:48:12.842-03:00Powershell Remotely Get the last Boot time <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
Remotely Get the Last boot time using powershell<br />
<br />
Replace with your computer after -ComputerName<br />
<br />
Get-WmiObject -Class Win32_OperatingSystem -Property LastBootUpTime -ComputerName Eduardote-PC | select @{LABEL='LastBootUpTime';EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}}</form>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-4502629931176608612014-11-05T02:21:00.000-03:002014-11-07T01:59:38.595-03:00Remotely obtain a list of Windows shares, physical Path and Share Permissions in CSV or Excel formatHave you ever needed to present a quick report of a Server's Shares, the Path of each share, and maybe the share permissions assigned to each share?<br />
If that is the case you would probably needed to present it in Excel or similar format.<br />
<br />
So Here's a way to do it, copy the next content on a .bat or .cmd:<br />
=================================================================<br />
del shares.txt<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Set Servername=YOUR-SERVER-NAME<br />
@ECHO OFF<br />
for /f "Skip=4 Tokens=1 delims=:" %%p in ('rmtshare \\%servername%^|find /v /i "IPC$"^|find /v /i "The command completed successfully."^|sed "s/[ \t[a-z]]*$//I"') do (echo \\%servername%\%%p>>shares.txt)<br />
sed -i "s/\s*[a-z]*$//I" shares.txt && del sed*.<br />
del shares-with-quotes.txt<br />
sed -i "s/&/^&/g" shares.txt<br />
del sed*.<br />
for /f "tokens=*" %%i in (SHARES.txt) do echo %%i | sed -e "s;\(.*\\\);\1"";" | sed "$s/.$/""/" >>shares-with-quotes.txt<br />
<br />
REM lista share permissions<br />
REM EL LOG TIENE QUE ESTAR FORMADO DE UNA FORMA ESPECIAL POR EJ \\SERVER\"SHARE"<br />
<br />
<br />
REM ESTA LINEA SIRVE PARA MODELAR EL ARCHIVO INPUT: for /f "tokens=*" %%i in (SHARES.txt) do echo %%i | sed -e "s;\(.*\\\);\1"";" | sed "$s/.$/""/" >>shares-with-quotes.txt<br />
<br />
for /f "tokens=*" %%i in (shares-with-quotes.txt) do (<br />
rmtshare %%i| sed -nE "s/^Share name *(\\\\.*)/\1/p;s/^Path *(.*)$/\1/p;/Permissions:/,/The command completed successfully/{/Permissions:\^^|The command completed successfully/!p}" | sed "{:q;N;s/\n/;/g;t q}" | sed "s/;\\\\/;\n\\\\/g" | sed "s/;$//" >> rmtshares2.log 2>&1<br />
)<br />
sed -i "s/Permissions:;//g;s/ *.:. /:/g;s/ \\//g;s/;Permissions://g" rmtshares2.log<br />
move rmtshares2.log LISTASHARE.TXT<br />
del sed*.<br />
<div>
=================================================================<br />
The output as it can be see is going to be: LISTASHARE.TXT but rename it as .csv if you prefer.<br />
It will get the list of shares from the server, and will obtain the physical path, and the permissions in CSV format so it is importable into excel and do a TEXT TO COLUMNS using semicolons. </div>
<div>
<br /></div>
<div>
What executables or binaries do I need?<br />
sed.exe (and its dependencies 3 .DLLs)<br />
rmtshare.exe (Microsoft tool) </div>
<div>
<br />
You can get all together including the scripts and an additional script where you just need to fill in specifically a list of shares you want into a file named shares.txt then run otro.cmd<br />
From here: <a href="http://adf.ly/tlVc6">Click here please</a> (it is a link from adfly, just click on the SKIP AD button which will appear after 5 Seconds). </div>
<div>
Then you can just click on the file which is hosted on mega.co.nz </div>
<div>
Important, the zip file has a password to make sure it was not edited or anything like that: </div>
<div>
Password: edu-naka.blogspot.com</div>
<div>
In this file: shares-csv.zip you will find:<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOohQwUDrqWqeL6smZJOJT07x94c7rLedstVI7tWsGMmdyiNJ8qyMMJU0wkpyT79srCzLwEcpuFH9bVOAWGt0UA-IjWFWYmuo9G6XzA5VxyIHFLJajhe9ZJduIDwpGEhgcR12EF8JgUVuR/s1600/shares-csv.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOohQwUDrqWqeL6smZJOJT07x94c7rLedstVI7tWsGMmdyiNJ8qyMMJU0wkpyT79srCzLwEcpuFH9bVOAWGt0UA-IjWFWYmuo9G6XzA5VxyIHFLJajhe9ZJduIDwpGEhgcR12EF8JgUVuR/s1600/shares-csv.png" height="97" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Content of the Shares-csv.zip</td></tr>
</tbody></table>
<br /></div>
<div>
sed.exe and its dependencies 3 DLL files(unix port you may find it http://gnuwin32.sourceforge.net/packages/coreutils.htm) </div>
<div>
rmtshare.exe (alternative location you may find it ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/ at least for now) </div>
<div>
and Two scripts: </div>
<div>
5.cmd: just edit the file and where it says <span class="Apple-tab-span" style="white-space: pre;"> </span>Set Servername=type your server name here and save it. For example <span class="Apple-tab-span" style="white-space: pre;"> </span>Set Servername=FileSERVER1</div>
<div>
otro.cmd: for this all what you need to do is to fill in a text file named shares.txt with a list of share (do not leave any space that is not required for example "\\server1\share1 " it should read "\\server1\share1" (without the quotes)).<br />
<br />
The result could look similar to this: (open or paste the content of Listashare.txt with excel). </div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij1qLu8cSsd_H8MQ_yDJFxysIiJJigjjeRhzxW3pI8f48FxppBwNoqkR4cBobS8pz-7wh0Mhzva4I2Wz6Lsxfl94jhzUP4yVHl6pxooYL1PGJHj5yk1W6qnZXcCJ9RjLmUgsFyB0H5PJE_/s1600/shares.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij1qLu8cSsd_H8MQ_yDJFxysIiJJigjjeRhzxW3pI8f48FxppBwNoqkR4cBobS8pz-7wh0Mhzva4I2Wz6Lsxfl94jhzUP4yVHl6pxooYL1PGJHj5yk1W6qnZXcCJ9RjLmUgsFyB0H5PJE_/s1600/shares.png" height="184" width="640" /></a></div>
<br /></div>
<div>
<br />
If you use it leave me a comment, tell me if you liked it. Try testing it as much as possible.</div>
<div>
<br />
And thanks to my collegue friend Seba Bistakis (he gave me a piece of code with sed.exe to avoid using tr.exe).</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-13012685159228959632014-10-23T21:18:00.000-03:002014-10-23T21:21:41.275-03:00Excel Find #N/A cellsWhenever you need to find cells with #N/A for example Cell A2:<br />
<b>=IF(ISNA(A2),"","IT IS NOT N/A") </b><br />
<div>
Look for empty cells<br />
<br />
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-55094437425858174212014-01-17T22:25:00.001-03:002014-01-20T22:28:43.192-03:00Lenovo Thinkpad FAN Control on Linux RHEL 6.4 & UbuntuThis should work for most flavors, <br />
<br />
To Start your FAN at maximum level (7) type: <br />
sudo su<br />
sudo echo "options thinkpad_acpi experimental=1 fan_control=1" >/etc/modprobe.d/thinkpad_acpi.conf<br />
sudo modprobe -r thinkpad_acpi && sudo modprobe thinkpad_acpi<br />
echo level 7 | sudo tee /proc/acpi/ibm/fan<br />
exit <br />
<br />
This was tested on Thinkpad T430, and by the way the key distribution for this keyboard is so lame. Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5018158998181662660.post-78782390270815205172011-05-24T14:13:00.002-03:002011-05-24T14:18:06.195-03:00Windows 2003 : Powershell: Internal Windows PowerShell error. Loading managed Windows PowerShell failed with error 80131522.If after attempting to open Powershell you receive this error, <br />Internal Windows PowerShell error. Loading managed Windows PowerShell failed with error 80131522.<br /><br />You may have already tried to re-install powershell and it's still failing to open.<br /><br />Resolution: <br />Uninstall Powershell / Repair (in my case used the rapair option) or reinstall .net framework 2.0 / Install Powershell. <br /> <br />1. Uninstall Powershell.<br /> <br />STEPS:<br />I. Try and reinstall PowerShell by running the install file again, i.e. <br />WindowsServer2003-KB926139-x86-ENU.exe<br /> <br />-The uninstall will be listed in Add or Remove Programs as follows:<br />Windows Server 2003: "Hotfix for Windows Server 2003 (KB926139)"<br />Windows XP: "Windows PowerShell(TM) 1.0"<br /> <br />II. Manually remove the Installation folder(s):<br /> <br />Windows PowerShell 1.0 uses Package Installer technology for Windows XP-based and <br />for Windows Server 2003-based installations. The location of the Windows PowerShell <br />installation folder is not configurable.<br /> <br />On x86-based versions of Windows, Windows PowerShell 1.0 is installed in the <br />following folder: <br /> <br />%windir%\System32\WindowsPowerShell\V1.0<br /> <br />Note: in this folder, %windir% represents the Windows system folder. Typically, <br />this folder is C:\Windows.<br /> <br />By default, both the 32-bit and 64-bit versions of Windows PowerShell are installed <br />in the following locations on x64-based and Itanium-based versions of Windows:<br /> <br />The 64-bit version of Windows PowerShell is installed in the following folder: <br />%windir%\system32\WindowsPowerShell\V1.0 <br /> <br />The 32-bit version of Windows PowerShell is installed in the following folder: <br />%windir%\Syswow64\WindowsPowerShell\V1.0 <br /> <br />Note: in these folders, %windir% represents the Windows system folder. Typically, <br />this folder is C:\Windows.<br /> <br />III. Remove the registry key:<br /> <br />HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell<br /> <br /> <br /> <br />2. Reinstall .Net Framework 2.0 or Repair if not able to reinstall.<br /> <br />Microsoft .NET Framework, versión 2.0, Redistributable Package (x86) (Paquete redistribuible de Microsoft .NET Framework versión 2.0)<br />http://www.microsoft.com/downloads/es-es/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displayLang=es<br /> <br />How to repair an existing installation of the.NET Framework<br />http://support.microsoft.com/kb/306160/en-us<br /> <br /> <br />IV. Reinstall .NET Framework 2.0<br /> <br />Note: if you receive an error like the following, then chances are .NET Framework <br />2.0 is busted:<br /> <br />An error in updating your system has occurred.<br />Select 'OK' to undo the changes that have been made.<br /> <br /><br />V. Check the Event logs for any errors/warnings with PowerShell and/or <br />MSIINSTALLER<br /> <br /><br />VI. Confirm that WMI is functioning properly by grabbing a WMIDIAG log:<br />http://www.microsoft.com/downloads/details.aspx?FamilyID=d7ba3cd6-18d1-4d05-b11e-4c6<br />4192ae97d&DisplayLang=en<br /> <br />VII. Enable .MSI logging: KB223300 / KB314852Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-5018158998181662660.post-52832078992952686472011-04-08T22:41:00.003-03:002011-04-11T23:21:33.514-03:00Migrate/Copy CIF Share on EMC Celerra between two filesystemsI was doing a robcopy of all the files to be moved. <br />But there's a faster method, which is still file level based: <br />https://community.emc.com/message/381096#381096<br />server_archive server_2 -r -w -J /fs1_casa /fs2_casa<br /><br />Tested on the Celerra Simulator, worked like a charm, <br />Update: tested on my work environment worked fine. <br /><br />So next step is to update a network share (CIF Share) to the new path: <br />The next example will point Shared folder Share1 which is currently pointing to /fs1_casa/Share1 to /fs1_casa/Share10, the netbios option is to mark that server as the only owner of that cif share: <br /><br />server_export server_2 -P cifs -n Share1 -option netbios=CIFSERVER1 /fs1_casa/Share10<br />Worked fine.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-70955830648123087332011-02-27T16:57:00.012-03:002011-04-01T18:47:04.551-03:00PSEXEC and system VariablesIf you need to get some system variables remotely but you don't want to copy any file on the remote system (for example because you don't know which is the %systemdrive% there are a courple of ways to do that.<br /><br />Psexec doesn't work with system variables on the remote computer, for example if you type psexec \\anothercomputer cmd /c echo %computername% it will echo hostname of from where you are running psexec.<br /><br />You might have heard of <a href="http://officewarfare.net/index.php/owexec/">owexec</a> it will let you run the command you want using the credentials of a loggedon user on the remote computer.<br /><br />But it's not exactly what I needed, I just need to get system variables and without any user being logged on the remote computer. Plus it uses WMI, and that could be a problem if your computer does have a policy not to allow it.<br /><br />So it just depends on your imagination:<br /><br />psexec \\nodito1 cmd /c "for /f "TOKENS=2 DELIMS==" %i in ('set ^| find /i "systemdrive"') do @echo %i" > c:\cerdofunciona.txt<br />psexec \\nodito1 cmd /c "for /f "TOKENS=2 delims==W" %i in ('set ^| find /i "windir"') do @echo %i" > c:\cerdofuncional.txt<br />psexec \\nodito1 cmd /c "for /f "TOKENS=* delims==" %i in ('set ^| find /i "computername"') do @echo %i" > c:\edumarcaregistrada.txt<br /><br /><a href="http://farm6.static.flickr.com/5217/5483356182_0e2fbd093a_b.jpg"><img style="cursor:pointer; cursor:hand;width: 1024px; height: 263px;" src="http://farm6.static.flickr.com/5217/5483356182_0e2fbd093a_b.jpg" border="0" alt="" /></a>Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-5018158998181662660.post-47267927222091395212011-01-31T01:08:00.011-03:002011-02-06T02:27:00.361-03:00SDDDSM vs DISK MANAGER&DEVICE MANAGERFor some reason (unknown) after the installation of two VSS hotfixes, (KB940349: http://support.microsoft.com/kb/940349<br />KB951568: http://support.microsoft.com/kb/951568) all the SAN LUNs (on SVC, using SDDDSM 2.4.0.2 Nov 2009 as multipath software) stopped to appear on the Disk Manager. Although they were visible on the Device Manager. <br /><br />System Event log : shows event ID 271<br />Event Type: Information<br />Event Source: PlugPlayManager<br />Event Category: None<br />Event ID: 271<br />Date: 01/30/2011<br />Time: 1:35:54 AM<br />User: N/A<br />Computer: MLISINVWPORDBD1<br />Description:<br />The Plug and Play operation cannot be completed because a device driver is preventing the device from stopping. The name of the device driver is listed as the vetoing service name below. <br /><br />Vetoed device: MPIO\DISK&VEN_IBM&PROD_2145&REV_0000\1&7F6AC24&0&3630303530373638303138453033333230303030303030303030303030343634 <br />Vetoing device: STORAGE\Volume\1&3735c57b&0&LDM#{5abb1f7e-8a56-11df-b068-806e6f6e6963} <br />Vetoing service name: FileSystem\Ntfs <br />Veto type 6: PNP_VetoDevice <br /><br />When Windows attempts to install, upgrade, remove, or reconfigure a device, it queries the driver responsible for that device to confirm that the operation can be performed. If any of these drivers denies permission (query-removal veto), then the computer must be restarted in order to complete the operation.<br /><br />User Action<br />Restart your computer.<br />---------------------------------------------------------------------------------<br />datapath query device worked fine : <br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7CB_QD2vhGwbEbMLCgoYWQcH-iIcr8cenizwv58qnua1TwhnTBlja_izV1uJSnAYxmbBFQLKQMuR9PS93_sZfY0hyphenhyphenrdGtcL3J3-5dPj57-DtTwRQ6OcaL9rCBFBukvJXdMssUh8wrIrMV/s1600/5.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 182px; height: 200px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7CB_QD2vhGwbEbMLCgoYWQcH-iIcr8cenizwv58qnua1TwhnTBlja_izV1uJSnAYxmbBFQLKQMuR9PS93_sZfY0hyphenhyphenrdGtcL3J3-5dPj57-DtTwRQ6OcaL9rCBFBukvJXdMssUh8wrIrMV/s200/5.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5568198586895082738" /></a><br /><br /><br />---------------------------------------------------------------------------------<br />Tried to uninstall the hotfixes but didn't work. <br />Tried to update the HBA Drivers but didn't work. <br />---------------------------------------------------------------------------------<br />Until we saw the properties of the multipath disk at the device manager: <br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO69iQhLKpBj2yIHlg9NHmK0t8P87PVjS_CT4RZIHyoMrK55wCQCNCxg3ouQL9CWybWponkEODDGtWre7ZXrkINNAgd4Xp9SticaISSEWPUCIo0ZRk-TqEvQQmfJ_qSG-HKl_zRfQapUrZ/s1600/1.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 68px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO69iQhLKpBj2yIHlg9NHmK0t8P87PVjS_CT4RZIHyoMrK55wCQCNCxg3ouQL9CWybWponkEODDGtWre7ZXrkINNAgd4Xp9SticaISSEWPUCIo0ZRk-TqEvQQmfJ_qSG-HKl_zRfQapUrZ/s200/1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5568197955521253906" /></a><br /><br />And this is how it looks on another server that the SAN LUNs were visible at the Disk Management: <br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2GTAH-PodTqMCVkvQW69rP8e9Jj66FnRs_qfjwY2hnJfMDNOSiFXPh1zhK3NGZCeb0Y9BRE6de6WfCQ0ZaBJn0b1pj216jDvWSp0XE15x2N2_DifGN1tnKQvO7yKBuio4HKZSGfHU63C5/s1600/4.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 60px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2GTAH-PodTqMCVkvQW69rP8e9Jj66FnRs_qfjwY2hnJfMDNOSiFXPh1zhK3NGZCeb0Y9BRE6de6WfCQ0ZaBJn0b1pj216jDvWSp0XE15x2N2_DifGN1tnKQvO7yKBuio4HKZSGfHU63C5/s200/4.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5568198245825776562" /></a><br /><br /><br /><br /><blockquote><strong>SOLUTION: UNINSTALL SDDDSM and INSTALL A NEW VERSION OF SDDDSM.</strong></blockquote> <br />It worked fine.<br /><br />Update: check the version of dmadmin.exe if it's not the one from year 2008 then update it and try again. <br />The newer version of SDDDSM we installed was 2.4.3Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-47291540649414174762011-01-07T02:19:00.005-03:002011-01-07T02:31:41.544-03:00Script to get disk configuration - An Alternative to Disk Manager. (faster, easier, logged)Here's a very handy script when you need to capture the Disk Configuration of a server. Let's say you can Dynamic Disks, and you need to know how many LUNs are making a Windows OS Disk. <br /><br /><blockquote><br />REM I stole this code from my good greek friend. I hope he doesn't get angry, anyways I gave him some ideas so he shouldn't :)<br /><br /><br />@echo off<br /><br />if exist "%systemroot%\system32\diskpart.exe" set dskprt=%systemroot%\system32\diskpart.exe<br />if "%dskprt%" EQU "" goto END<br /><br />echo list disk>dskprt_script.doc<br />echo list volume>>dskprt_script.doc<br /><br />%dskprt% -s dskprt_script.doc>%computername%_diskpart.doc<br /><br />set /a cd=0<br />set /a cv=0<br /><br />findstr /c:" Disk " %computername%_diskpart.doc>dskprt_temp.doc<br />for /f %%a in (dskprt_temp.doc) do (<br />set /a cd+=1<br />)<br />set /a cd=%cd%-2<br /><br />findstr /c:" Volume " %computername%_diskpart.doc>dskprt_temp.doc<br />for /f %%a in (dskprt_temp.doc) do (<br />set /a cv+=1<br />)<br />set /a cv=%cv%-2<br /><br />del dskprt_temp.doc<br /><br /><br /><br /><br />del dskprt_script.doc<br />for /l %%a in (0,1,%cd%) do (<br />echo select disk %%a>>dskprt_script.doc<br />echo detail disk>>dskprt_script.doc<br />)<br />%dskprt% -s dskprt_script.doc>%computername%_disk.doc<br />del dskprt_script.doc<br />for /l %%a in (0,1,%cv%) do (<br />echo select volume %%a>>dskprt_script.doc<br />echo detail volume>>dskprt_script.doc<br />)<br />%dskprt% -s dskprt_script.doc>%computername%_volume.doc<br />del dskprt_script.doc<br /><br />echo Regards to Bistakis Pig.<br />pause<br /><br />:END <br /><br /></blockquote><br /><br />Make sure it's working the way you want. <br />And compare the result logs and running the diskpart commands manually (as some diskpart.exe version did have a bug and it didn't worked correctly using diskpart /script option).<br /><br />Alternatives but not as good to get LUNs configuration: <br />wmic partition list /format:htable >disk.html<br />wmic logicaldisk list /format:htable >logicaldisk.htmlUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-68646330846238404502010-08-23T17:52:00.008-03:002010-08-23T18:15:16.159-03:00MS Cluster 2008 vs DTC when the computer object has been manually added<br><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjibSI2zq98SshvLNeya7MPznldrYJGFchEXBkVHgiltE_JOczyl2ln7vuolKRrI3Cr2Yr4-bYWsV2S4zahQ-Vv-YX65AYzpMNHtcbulo02GMaOHtHRTqzM3zfE-8EdgTZDw8kPu98LETec/"><img style="MARGIN: 0px 10px 10px 0px; WIDTH: 480px; FLOAT: left; HEIGHT: 270px; CURSOR: hand" border="0" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjibSI2zq98SshvLNeya7MPznldrYJGFchEXBkVHgiltE_JOczyl2ln7vuolKRrI3Cr2Yr4-bYWsV2S4zahQ-Vv-YX65AYzpMNHtcbulo02GMaOHtHRTqzM3zfE-8EdgTZDw8kPu98LETec/" /></a><br /><br />Scenario : You have manually added the computer object (for each Cluster node and the cluster virtual name) on an specific OU on the AD.<br />You may find these error messages while trying to install MS DTC:<br /><br /><span style="color:#ff0000;">"is already in use in the Active Directory"<br />"Please work with your domain administrator to ensure that:<br />The cluster identity 'computername$' can create computer objects. By default all computer objects are created in the 'Computers' container; consult the domain administrator if this location has been changed.<br />The quota for computer objects has not been reached.<br />If there is an existing computer object, verify the Cluster Identity 'computername$' has 'Full Control' permission to that computer object using the Active Directory Users and Computers tool. "</span><br /><br /><br /><br />Solution: The computer object for the virtual cluster name needs to have full access on the new computer object (for the DTC resource) that you add, in this case for the DTC virtual cluster name.<br /><br />Let's say you have<br />Node1 ->Manually added<br />Node2 ->Manually added<br />ClusterX ->Manually added<br /><br />And you want to install DTC, for which you need a new cluster name, and you create a new computer object on the AD:<br />DTC-Cluster ->Manually added<br /><br />On the security properties for DTC-Cluster add full permissions to ClusterX computer object.Unknownnoreply@blogger.com6tag:blogger.com,1999:blog-5018158998181662660.post-55759393388853827472010-08-19T18:03:00.012-03:002010-08-23T06:14:27.849-03:00Script to verify RPC connectivity and log resultsThis script will check each server on serverlist.txt, then request for a DOMAIN\USERNAME and a Password. Try to connect to each server (net use \\server\IPC$) and log the results results (connect.txt)<br /><br />------------------------CHECKER.CMD----------------------------<br /><br />@SetLocal EnableDelayedExpansion<br />echo off<br />echo Type user : <br />echo e.g. Global\_nakame<br />set /p user=<br />echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>pass.com<br /> set /p pass=Password for %user%:<nul <br />for /f "tokens=*" %%i in ('PASS.com') do set pass=%%i<br />echo Processing...<br />for /F %%i in (serverlist.txt) do (<br />echo %%i<br />net use \\%%i\ipc$ /U:%user% %pass%<br />if !ErrorLevel! == 0 (Echo Connected to %%i with %user% user account >>connect.txt) ELSE (Echo Connection Failed for to %%i with %user% >>connect.txt)<br />)<br />@endlocal<br /><br />----------------------------------------------------------------<br />If you want, you can download it from <a href="http://uploadables.com/download/4154-checker.cmd">here</a><br /><br />Hail to the Pig.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-59625086022407350042010-01-27T19:36:00.006-03:002010-08-20T13:32:05.776-03:00Restart a service from the Command lineTaken from Robbie Allen webpage : Robust_restart.vbs<br />(the problem is that it doesn't work because of an underscore "_" before the strSvcName variable. Remove it just as it is listed below.<br />Of course you can specify the strComputer(server name) and strSvcName (service shortname, for e.g. Audiosrv and not "windows audio" cause it won't work in the other way).<br /><br />Restart.vbs<br />----------------------------------------------------------------------------------------------<br /><br />strService = "spooler" <br />strComputer = "." <br /><br />WScript.Echo "Restarting " & strService & "..." <br /><br />' Stop dependent services <br />Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") <br />Set objServiceList = objWMI.ExecQuery("Associators of " _ <br />& "{Win32_Service.Name='" & strService & "'} Where " _ <br />& "AssocClass=Win32_DependentService " & "Role=Antecedent" ) <br />For Each objService In objServiceList <br />WScript.Echo " Stopping " & objService.Name <br />objService.StopService() <br />Next <br />WScript.Sleep 10000 ' Pause to allow services to stop <br />' Stop target service <br />Set objService = objWMI.Get("Win32_Service.Name='" & strService & "'") <br />WScript.Echo " Stopping " & objService.Name <br />objService.StopService() <br />WScript.Sleep 10000 ' Pause to allow service to stop <br /><br />' Start target service <br />Set objService = objWMI.Get("Win32_Service.Name='" & strService & "'") <br />WScript.Echo " Starting " & objService.Name <br />objService.StartService() <br />WScript.Sleep 10000 ' Pause to allow service to start <br /><br />' Start dependent services <br />Set objServiceList = objWMI.ExecQuery("Associators of " _ <br />& "{Win32_Service.Name='" & strService & "'} Where " _ <br />& "AssocClass=Win32_DependentService " & "Role=Antecedent" ) <br />For Each objService In objServiceList <br />WScript.Echo " Starting " & objService.Name <br />objService.StartService() <br />Next <br />WScript.Echo "The script has completed successfully."<br />----------------------------------------------------------------------------------------------<br /><br />To be run from a command line/script<br />Just type : cscript restart.vbs<br /><br /><br />What's the difference with this and doing a net stop service /y & net start service?<br />The difference is that if you have dependant services they will not start.<br />While using this script, it will start any dependant service as well as the requested service but it's not perfect. It will fail to tell the truth if a dependant service doesn't start. I would use sc.exe to query the service state after the restart script finished.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5018158998181662660.post-69134746527358439992010-01-26T18:31:00.004-03:002010-01-26T18:44:54.866-03:00Drag 'n Drop / Copy Paste not working among other GUI problems - SOLVEDI had this problem on a server an someone asked me try to resolve it before doing a fresh installation.<br /><br />Windows 2000 / Windows 2003<br /><strong><span style="font-size:130%;">Sympthoms :</span> </strong><br /><br /><span style="font-size:85%;">When you Control-C (copy) files,text,images,anything / Control-V (paste), nothing ocurrs<br /><br />When you click Web page hyperlinks that are supposed to open in a new window, nothing occurs.<br /><br />When you right-click a hyperlink on a Web page and then click Open in New Window, nothing occurs.<br /><br />When you click a hyperlink in Microsoft Outlook or in Microsoft Outlook Express, the hyperlink does not work.<br /><br />When you try to drag an item to the Start menu or to any folder on the system, the pointer changes to a circle that has a slash through it, and you cannot drop anything.<br /><br />When you click Find (on This Page) on the Edit menu in Microsoft Internet Explorer, the operation may not work or may work only one time.<br /><br />When you click Start, click Search, type all or part of a file name in the All or part of file name text box, and then click Search, nothing occurs.<br /><br />When you click Start, click Search, click Other Search Options, and then click Search the Internet, nothing occurs.<br /><br />When you try to start Microsoft Office Assistant, you receive the following error message:<br />Problem occurred using Office Assistant, Do you want to reinstall it?<br /><br />When you try to drag a file from Microsoft Outlook 2000 or from Microsoft Office Outlook 2003 to a folder, you receive the following error message:<br />Cannot create another system semaphore.<br /><br />You cannot print from Internet Explorer.<br /><br />You cannot print HTML messages in Outlook.<br /><br />When you click Start and then click Windows Update, nothing occurs.<br /><br />When you try to download an update from the Windows Update Web site in Internet Explorer, Windows Update appears not to function. Although you see the "Preparing to Download" message, the progress indicator does not change<br /></span><br />Yet, if you trying doing these things through a command line without using the GUI it works. So what's the problem : someone messed with the components.<br /><br /><span style="font-size:130%;"><strong>Solution :</strong></span><br /><br />To work around this issue, locate and then delete the DefaultAccessPermission registry entry. To do this, follow these steps:<br />Click Start, click Run, type regedit, and then click OK.<br />Locate and then click the following registry subkey:<br />HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole<br />In the right pane, right-click DefaultAccessPermission, and then click Delete.<br />In the Confirm Value Delete dialog box, click Yes.<br />Exit Registry Editor.<br />Log off the computer, and then log back on to the computer.<br /><br />It took me a while to find the kb/900960/ because they didn't include the copy/paste sympthom.<br /><br />Just after those magic steps, the server began to work properly and I didn't have to make the reinstallation (having found the solution on the day previous to the reinstallation, lucky me).Unknownnoreply@blogger.com0