Monday, September 30, 2013

More automatic VirtualBox silent install

Main program:
@echo off
setlocal EnableDelayedExpansion

set path=%path%;%~dp0
set vb=%temp%\vb

:dl
if not exist "%~dp0VirtualBox*-Win.exe" (
for /f "tokens=*" %%a in ('^
wget -qO- --no-check-certificate ^
https://www.virtualbox.org/wiki/Downloads ^|
sed "s/\d034/\n/g" ^|
sed -n "/.exe/p"') do (
wget %%a --directory-prefix "%~dp0\"
)
)
echo chech if file has good consistence
7z x "%~dp0VirtualBox*-Win.exe" -o"%vb%" -y
if not !errorlevel!==0 (
del "%~dp0VirtualBox*-Win.exe"
goto dl
)

7z x "%vb%\*.iso" -o"%vb%" -y
xcopy /i /c /r /s /y "%vb%\cert\*.cer" "%~dp0"

if not exist "%~dp0certutil.exe" (
wget http://download.microsoft.com/download/c/7/5/c750f1af-8940-44b6-b9eb-d74014e552cd/adminpak.exe
7z e "%~dp0adminpak.exe" i adminpak.msi -O"%~dp0"
7z e "%~dp0adminpak.msi" i certutil.exe certadm.dll -O"%~dp0"
del "%~dp0adminpak.exe" /Q /F
del "%~dp0adminpak.msi" /Q /F
)

certutil -addstore "TrustedPublisher" "%~dp0oracle-vbox.cer"
for /f "delims=" %%f in ('dir /b "%~dp0VirtualBox-*-Win.exe"') DO (
"%~dp0%%f" -s
)

rd "%vb%" /Q /S

endlocal
This contains all necessary files
https://github.com/catonrug/latest-virtualbox-silent-install-for-windows/archive/master.zip

How it works?
This batch file downloads latest Windows (exe) installer from VirtualBox.org
Since wget is used to download the setup file and the VirtualBox setup is like 100mb big then we later need to check VirtualBox*-Win.exe file consistence. I figured it that 7z library can try extract content and if it reports errorlevel 0 and it means that all files in archive are good.

If certutil is not found then it will be automatically downloaded from download.microsoft.com server.

If there is already VirtualBox*-Win.exe file found it will be used instead of downloading new file - you need to manually delete old file to automatically download latest version.

certutil.exe autoget code

This code you can embed whenever need to use certutil.exe

get-certutil.exe.cmd
@echo off
set path=%path%;%~dp0
if not exist "%~dp0certutil.exe" (
wget http://download.microsoft.com/download/c/7/5/c750f1af-8940-44b6-b9eb-d74014e552cd/adminpak.exe
7z e "%~dp0adminpak.exe" i adminpak.msi -O"%~dp0"
7z e "%~dp0adminpak.msi" i certutil.exe certadm.dll -O"%~dp0"
del "%~dp0adminpak.exe" /Q /F
del "%~dp0adminpak.msi" /Q /F
)
Related files:
http://download.microsoft.com/download/c/7/5/c750f1af-8940-44b6-b9eb-d74014e552cd/adminpak.exe
cb923ecd59fe1ed4e2496d68ac64a17e
8a755a6aeea532e3ace871cc87e5bd4a29351a50

Sunday, September 29, 2013

Friday, September 27, 2013

Thursday, September 26, 2013

Install VirtualBox on Slackware

This is tested and works well on Slackware 14 using full install

Go to VirtualBox Linux download page at
https://www.virtualbox.org/wiki/Linux_Downloads

Select package from All distributors

Download i386 package if you run 32-bit slackware, download AMD64 if run 64-bit slackware.

When the download is complete you have to make the downloaded file executable.

Login root in directory (probably Downloads) and run
chmod +x VirtualBox-4.2.18-88781-Linux_amd64.run

Now you can launch the installer with
./VirtualBox-4.2.18-88781-Linux_amd64.run
All done. VirtualBox now is installed.

It is recommended to add all users who will use VirtualBox to group vboxusers
You can do it by logging out current user (if not root)
Now login root and lauch
usermod -a -G vboxusers first_user
usermod -a -G vboxusers another_username
Now log out root and you can log in again standard user.

It is recommended to not use VirtualBox as root user.

Wednesday, September 25, 2013

Print Secured PDF files. Print section is inactive


This method needs a lot of resource depending on page counts.
But it works so well than you have to keep in mind it if you have no options.

The solution is to upload pdf to your google account at drive.google.com.

By opening this file on google docs you are able to save each page as PNG image.

You have to save each page manually by clicking on each page and choose "Save Image As"
If you have 6 pages then it like 18 clicks away - one right and two lefty per page.

It's pretty hard to do that so you better take the cash and buy the secured material in book store ;)


Mirror of Images2PDF:
https://drive.google.com/folderview?id=0BxmEiwnrWfmmYjJPWGtCQjV0enM&usp=sharing

Enter RAID setup Gigabyte H77M-D3H

Wait till this startup screen ends


Now quickly hold down CTRL key and press I like four times per second

Now you get to the RAID utility screen

Note that if you have two monitors connected then the RAID utility will be translated to VGA port only.
So you better turn on the monitor which is connected to VGA ports ;)

Monday, September 23, 2013

Install BeautifulSoup python module for windows
error: package directory 'bs4' does not exist
import BeautifulSoup, ImportError: No module named BeautifulSoup

import BeautifullSoup
ImportError: No module named BeautifulSoup

To solve this situation download archive
http://www.crummy.com/software/BeautifulSoup/bs4/download/4.3/beautifulsoup4-4.3.1.tar.gz
508095f2784c64114e06856edc1dafed
59db0ac4c38f44111bfd5c2e642753b9dd52b75f

Extract all content to c:\

If your %path% does not include C:\Python27 you can not install this module with
C:\Python27\python.exe c:\path\to\beautifulsoup4-4.3.1\setup.py install
It should work but it don't :(
It reports:
error: package directory 'bs4' does not exist

What you can do is set C:\Python27 temporary in %path% variable. This will work only in this command prompt session.
cd beautifulsoup4-4.3.1
set path=%path%;C:\Python27
python setup.py install

The successful output of this will be
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\bs4
copying bs4\dammit.py -> build\lib\bs4
copying bs4\diagnose.py -> build\lib\bs4
copying bs4\element.py -> build\lib\bs4
copying bs4\testing.py -> build\lib\bs4
copying bs4\__init__.py -> build\lib\bs4
creating build\lib\bs4\builder
copying bs4\builder\_html5lib.py -> build\lib\bs4\builder
copying bs4\builder\_htmlparser.py -> build\lib\bs4\builder
copying bs4\builder\_lxml.py -> build\lib\bs4\builder
copying bs4\builder\__init__.py -> build\lib\bs4\builder
creating build\lib\bs4\tests
copying bs4\tests\test_builder_registry.py -> build\lib\bs4\tests
copying bs4\tests\test_docs.py -> build\lib\bs4\tests
copying bs4\tests\test_html5lib.py -> build\lib\bs4\tests
copying bs4\tests\test_htmlparser.py -> build\lib\bs4\tests
copying bs4\tests\test_lxml.py -> build\lib\bs4\tests
copying bs4\tests\test_soup.py -> build\lib\bs4\tests
copying bs4\tests\test_tree.py -> build\lib\bs4\tests
copying bs4\tests\__init__.py -> build\lib\bs4\tests
running install_lib
creating C:\Python27\Lib\site-packages\bs4
creating C:\Python27\Lib\site-packages\bs4\builder
copying build\lib\bs4\builder\_html5lib.py -> C:\Python27\Lib\site-packages\bs4\builder
copying build\lib\bs4\builder\_htmlparser.py -> C:\Python27\Lib\site-packages\bs4\builder
copying build\lib\bs4\builder\_lxml.py -> C:\Python27\Lib\site-packages\bs4\builder
copying build\lib\bs4\builder\__init__.py -> C:\Python27\Lib\site-packages\bs4\builder
copying build\lib\bs4\dammit.py -> C:\Python27\Lib\site-packages\bs4
copying build\lib\bs4\diagnose.py -> C:\Python27\Lib\site-packages\bs4
copying build\lib\bs4\element.py -> C:\Python27\Lib\site-packages\bs4
copying build\lib\bs4\testing.py -> C:\Python27\Lib\site-packages\bs4
creating C:\Python27\Lib\site-packages\bs4\tests
copying build\lib\bs4\tests\test_builder_registry.py -> C:\Python27\Lib\site-packages\bs4\tests
copying build\lib\bs4\tests\test_docs.py -> C:\Python27\Lib\site-packages\bs4\tests
copying build\lib\bs4\tests\test_html5lib.py -> C:\Python27\Lib\site-packages\bs4\tests
copying build\lib\bs4\tests\test_htmlparser.py -> C:\Python27\Lib\site-packages\bs4\tests
copying build\lib\bs4\tests\test_lxml.py -> C:\Python27\Lib\site-packages\bs4\tests
copying build\lib\bs4\tests\test_soup.py -> C:\Python27\Lib\site-packages\bs4\tests
copying build\lib\bs4\tests\test_tree.py -> C:\Python27\Lib\site-packages\bs4\tests
copying build\lib\bs4\tests\__init__.py -> C:\Python27\Lib\site-packages\bs4\tests
copying build\lib\bs4\__init__.py -> C:\Python27\Lib\site-packages\bs4
byte-compiling C:\Python27\Lib\site-packages\bs4\builder\_html5lib.py to _html5lib.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\builder\_htmlparser.py to _htmlparser.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\builder\_lxml.py to _lxml.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\builder\__init__.py to __init__.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\dammit.py to dammit.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\diagnose.py to diagnose.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\element.py to element.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\testing.py to testing.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\tests\test_builder_registry.py to test_builder_registry.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\tests\test_docs.py to test_docs.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\tests\test_html5lib.py to test_html5lib.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\tests\test_htmlparser.py to test_htmlparser.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\tests\test_lxml.py to test_lxml.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\tests\test_soup.py to test_soup.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\tests\test_tree.py to test_tree.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\tests\__init__.py to __init__.pyc
byte-compiling C:\Python27\Lib\site-packages\bs4\__init__.py to __init__.pyc
running install_egg_info
Writing C:\Python27\Lib\site-packages\beautifulsoup4-4.3.1-py2.7.egg-info
Now site-packages includes bs4 directory and beautifulsoup4-4.3.1-py2.7.egg-info

Now at the python programm code you need replace
import BeautifulSoap with from bs4 import BeautifulSoap.

I found out that it also works out by duplicating bs4 directory to BeautifulSoap

Check for BeautifulSoup latest version at
http://www.crummy.com/software/BeautifulSoup/bs4/download/

Related files:
http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi
0006d6219160ce6abe711a71c835ebb0
52936e98404349d02e64fec710d209f99197ce86

Source:
http://stackoverflow.com/questions/12228102/how-to-install-beautiful-soup-4-with-python-2-7-on-windows
https://www.youtube.com/watch?v=x9lXgsGxhVM at 27:15

mechanize module for windows, python, import mechanize, ImportError: No module named mechanize

import mechanize
ImportError: No module named mechanize

You have installed python2 on C:\Python27\

To solve this download http://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.5.zip
a497ad4e875f7506ffcf8ad3ada4c2fc
541a840abe38d11a9c3c796c4173f14fd24b45f7

Open archive and select only mechanize directory to extract

Extract it to C:\Python27\Lib\site-packages

Now you have ready to use mechanize module

Check for latest mechanize version:
http://wwwsearch.sourceforge.net/mechanize/download.html

Sunday, September 22, 2013

python urllib.urlopen

This is my first python program.
This works with python2 language but not work with python3 so to work together install:
http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi
0006d6219160ce6abe711a71c835ebb0
52936e98404349d02e64fec710d209f99197ce86

This is first example. This will show html source similar to wget -qO- http://google.com
Use your favorite text editor to save this as first.py
import urllib
htmlfile = urllib.urlopen("http://google.com")
htmltext = htmlfile.read()
print htmltext

Open "IDLE (Python GUI)"

Choose File -> Open

Actually now you can open every python (py) file with python editor

When the python code is loaded you can run the program by pressing F5 or choose Run -> Run Module

Second example will create an url array and print out only first 100 characters of each html file
second.py
import urllib
urls = ["http://google.com","http://mytimes.com", "http://cnn.com"]
i=0
while i< len(urls):
	htmlfile = urllib.urlopen(urls[i])
	htmltext = htmlfile.read()
	print htmltext[1:100]
	i+=1
Third example will extract page titles. Keep the tabs in while cycle otherwise nothing will work out.
third.py
import urllib
import re
urls = ["http://google.com","http://mytimes.com", "http://cnn.com"]
i=0
regex = '<title>(.+?)</title>'
pattern = re.compile(regex)
while i< len(urls):
	htmlfile = urllib.urlopen(urls[i])
	htmltext = htmlfile.read()
	titles = re.findall(pattern,htmltext)
	print titles
	i+=1
Source:
https://www.youtube.com/watch?v=kPhZDsJUXic

Thursday, September 19, 2013

autounattend.xml regional and language settings

<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>en-US</InputLocale>
<SystemLocale>lv-LV</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>
SystemLocale setting only change system locale setting under Administrative tab


<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>lv-LV</UserLocale>
UserLocale setting sets "Formats" format

Sets "Location"

And add new keyboard layouts


Full autounattend.xml can be found at
autounattend.xml examples for Windows 7

Wednesday, September 18, 2013

lock computer via screen saver

This will lock screen after 1 minute and prevent users to change screen saver settings
scrnsave.scr stands for "Blank" screensaver.

Create this as an user script.
reg add "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveActive /d 1 /f
reg add "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveTimeOut /d 180 /f
reg add "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaverIsSecure /d 1 /f
reg add "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v "SCRNSAVE.EXE" /d "C:\Windows\system32\scrnsave.scr" /f
Next one is much user friendly cause it lets user to choose the screen save which likes better
@echo off
setlocal EnableDelayedExpansion
reg add "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveActive /d 1 /f
reg add "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveTimeOut /d 60 /f
reg add "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaverIsSecure /d 1 /f

reg query "HKCU\Control Panel\Desktop" /v SCRNSAVE.EXE > nul 2>&1
if not !errorlevel!==0 (
if exist "C:\Windows\system32\scrnsave.scr" reg add "HKCU\Control Panel\Desktop" /v "SCRNSAVE.EXE" /d "C:\Windows\system32\scrnsave.scr" /f
if exist "C:\Windows\system32\Mystify.scr" reg add "HKCU\Control Panel\Desktop" /v "SCRNSAVE.EXE" /d "C:\Windows\system32\Mystify.scr" /f
if exist "C:\Windows\system32\Logon.scr" reg add "HKCU\Control Panel\Desktop" /v "SCRNSAVE.EXE" /d "C:\Windows\system32\Logon.scr" /f

)

endlocal
Remove customization
reg delete "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveActive /f
reg delete "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveTimeOut /f
reg delete "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaverIsSecure /f
reg delete "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v "SCRNSAVE.EXE" /f
These settings also can be found under Group policy. Just remember apply this policy to user objects NOT computer.

Code 80072EFD


Make sure the proxy settings is right.

Make sure you can get to the site the website really opens:
http://download.windowsupdate.com

Clear all windows update policy settings and redirect to original windows update server with:
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f
net stop wuauserv
rd %systemroot%\SoftwareDistribution /Q /S
SC sdshow wuauserv
SC sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
wuauclt.exe /detectnow

The Windows Preinstallation Environment component of the Assessment and Deployment Kit (ADK) is required and must be installed before Setup can continue

The Windows Preinstallation Environment component of the Assessment and Deployment Kit (ADK) is required and must be installed before Setup can continue. See http://go.microsoft.com/fwlink/?LinkID=252874

Download and run
http://download.microsoft.com/download/9/9/F/99F5E440-5EB5-4952-9935-B99662C3DF70/adk/adksetup.exe

Make sure to check "Windows Preinstallation Environmen (Windows PE)"

The Windows Deployment Tools component of the Assessment and Deployment Kit (ADK) is required and must be installed before Setup can continue

The Windows Deployment Tools component of the Assessment and Deployment Kit (ADK) is required and must be installed before Setup can continue. See http://go.microsoft.com/fwlink/?LinkID=252874

Download and run
http://download.microsoft.com/download/9/9/F/99F5E440-5EB5-4952-9935-B99662C3DF70/adk/adksetup.exe

Make sure to check Deployment tools

The User State Migration Tool component of the Assessment and Deployment Kit (ADK) is required and must be installed before Setup can continue

Upgrading System Center 2012 to SP1 you have to install User State Migration Tool.

"The User State Migration Tool component of the Assessment and Deployment Kit (ADK) is required and must be installed before Setup can continue. It is required on central administration sites and stand-alone primary sites. See http://go.microsoft.com/fwlink/?LinkID=252874"

Solution:
Download and run
http://download.microsoft.com/download/9/9/F/99F5E440-5EB5-4952-9935-B99662C3DF70/adk/adksetup.exe




Open Wizard and then select to install
"User State Migration Tool (USMT)"

Tuesday, September 17, 2013

Additional command support in windows batch job

I found this easy way to support any other command line tools placed side be side with batch file.
All you have to do is set
set path=%path%;%~dp0
%dp0 will report and add current directory path to global windows %path% variable just in current session. When the sessions ends, the %path% variable will be the old one.

If you think and use cd "%~dp0" then i can say that this trick will not work if your batch file is located on drive D:\ and you will run it by selecting "Run as administrator".

Deploy software updates, set it and forget, SCCM

This is quit based on
https://secure.cbtnuggets.com/it-training-videos/course/microsoft-system-center-config-sccm-70-243/9219
Full video can be found somewhere else if looking for.


And the magic part
Superseded can be useful to set to Yes.
For example this will install Office service package instead of small updates.

The only reason to set it to No that you have not configured to update computers out of working hours.
The office service pack install is huge amount of CPU and lot of minutes of distracting computer performance at client side.

Separate small update installation also can be distracting, but not as much as service pack install.

Ths is how it looks like at the end. All required updates are applied.

If the update is not required to any computer then it is not deployed

Monday, September 16, 2013

Sunday, September 15, 2013

x86 and x64 configuration in one autounattend.xml, Windows 7

Based on my autounattend.xml examples for windows 7 there are option to write booth x86 and x64 configuration in one file which can be flexible used on two kind of mediums:
32-bit Windows 7 OEM (30-days free): http://msft.digitalrivercontent.net/win/X17-59183.iso
64-bit WIndows 7 OEM (30-days free): http://msft.digitalrivercontent.net/win/X17-59186.iso

I have writed zero touch installation instruction to introduce how to add custom app silent scripts.

This autounattend.xml is ready to use for booth mediums - 32-bit and 64-bit windows 7.
It will delete stuff on HDD without prompting.
Remove <Size>20480</Size> line two times if don't want to erase HDD automatically.

autounattend.xml
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        
 <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SetupUILanguage>
                <UILanguage>en-US</UILanguage>
            </SetupUILanguage>
            <InputLocale>en-US</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UserLocale>en-US</UserLocale>
        </component>
  
 <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SetupUILanguage>
                <UILanguage>en-US</UILanguage>
            </SetupUILanguage>
            <InputLocale>en-US</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UserLocale>en-US</UserLocale>
        </component>
  
        <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DiskConfiguration>
                <Disk wcm:action="modify">
                    <CreatePartitions>
                        <CreatePartition wcm:action="modify">
                            <Order>1</Order>
                            <Type>Primary</Type>
                            <Size>20480</Size>
                        </CreatePartition>
                    </CreatePartitions>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="modify">
                            <Active>true</Active>
                            <Format>NTFS</Format>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                            <Extend>false</Extend>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
                <WillShowUI>OnError</WillShowUI>
            </DiskConfiguration>
            <ImageInstall>
                <OSImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>1</PartitionID>
                    </InstallTo>
                    <WillShowUI>OnError</WillShowUI>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/NAME</Key>
                            <Value>Windows 7 PROFESSIONAL</Value>
                        </MetaData>
                    </InstallFrom>
                </OSImage>
            </ImageInstall>
            <UserData>
                <AcceptEula>true</AcceptEula>
                <FullName></FullName>
                <Organization></Organization>
                <ProductKey>
                    <WillShowUI>OnError</WillShowUI>
                    <Key>HYF8J-CVRMY-CM74G-RPHKF-PW487</Key>
                </ProductKey>
            </UserData>
        </component>
  
 <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DiskConfiguration>
                <Disk wcm:action="modify">
                    <CreatePartitions>
                        <CreatePartition wcm:action="modify">
                            <Order>1</Order>
                            <Type>Primary</Type>
                            <Size>20480</Size>
                        </CreatePartition>
                    </CreatePartitions>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="modify">
                            <Active>true</Active>
                            <Format>NTFS</Format>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                            <Extend>false</Extend>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
                <WillShowUI>OnError</WillShowUI>
            </DiskConfiguration>
            <ImageInstall>
                <OSImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>1</PartitionID>
                    </InstallTo>
                    <WillShowUI>OnError</WillShowUI>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/NAME</Key>
                            <Value>Windows 7 PROFESSIONAL</Value>
                        </MetaData>
                    </InstallFrom>
                </OSImage>
            </ImageInstall>
            <UserData>
                <AcceptEula>true</AcceptEula>
                <FullName></FullName>
                <Organization></Organization>
                <ProductKey>
                    <WillShowUI>OnError</WillShowUI>
                    <Key>HYF8J-CVRMY-CM74G-RPHKF-PW487</Key>
                </ProductKey>
            </UserData>
        </component>  
  
    </settings>
 
    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RegisteredOrganization></RegisteredOrganization>
            <TimeZone>Pacific Standard Time</TimeZone>
            <RegisteredOwner></RegisteredOwner>
            <AutoLogon>
                <Password>
                    <Value></Value>
                    <PlainText>true</PlainText>
                </Password>
                <Username>administrator</Username>
                <LogonCount>3</LogonCount>
                <Enabled>true</Enabled>
            </AutoLogon>
            <ProductKey>HYF8J-CVRMY-CM74G-RPHKF-PW487</ProductKey>
            <ComputerName />
        </component>
  
 <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RegisteredOrganization></RegisteredOrganization>
            <TimeZone>Pacific Standard Time</TimeZone>
            <RegisteredOwner></RegisteredOwner>
            <AutoLogon>
                <Password>
                    <Value></Value>
                    <PlainText>true</PlainText>
                </Password>
                <Username>administrator</Username>
                <LogonCount>3</LogonCount>
                <Enabled>true</Enabled>
            </AutoLogon>
            <ProductKey>HYF8J-CVRMY-CM74G-RPHKF-PW487</ProductKey>
            <ComputerName />
        </component>
  
    </settings>
 
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <ProtectYourPC>1</ProtectYourPC>
                <NetworkLocation>Work</NetworkLocation>
            </OOBE>
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value></Value>
                            <PlainText>true</PlainText>
                        </Password>
                        <Name>administrator</Name>
                        <Group>Administrators</Group>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <AutoLogon>
                <Enabled>true</Enabled>
                <Username>Administrator</Username>
                <LogonCount>3</LogonCount>
            </AutoLogon>
            <RegisteredOrganization></RegisteredOrganization>
            <RegisteredOwner></RegisteredOwner>
        </component>
  
 <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <ProtectYourPC>1</ProtectYourPC>
                <NetworkLocation>Work</NetworkLocation>
            </OOBE>
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value></Value>
                            <PlainText>true</PlainText>
                        </Password>
                        <Name>administrator</Name>
                        <Group>Administrators</Group>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <AutoLogon>
                <Enabled>true</Enabled>
                <Username>Administrator</Username>
                <LogonCount>3</LogonCount>
            </AutoLogon>
            <RegisteredOrganization></RegisteredOrganization>
            <RegisteredOwner></RegisteredOwner>
        </component>  
  
    </settings>
</unattend>

Saturday, September 14, 2013

google apps invalid request

I have bought multiple domains and some of them i decided to not continued.
After a few months when i not renew the domain i am not able to login at apps.google.com or admin.google.com. I recieve invalid request.
Here is how i did:
Reset google apps password by going to
https://google.com/a/REPLACETHISWITHYOUROMAIN.com/ForgotAdminAccountInfo
This will bring you to similar mage like this

You will receive reset link to you google email.

You will click on that link and type new password.

Now you have more passwords - one of primary google account and second, third or forth password of each domain at
https://admin.google.com/

To authenticate at apps.google.com or admin.google.com use
bloggeradmin@REPLACETHISWITHYOUROMAIN.com
and your domain password.

Source:
http://blogging.nitecruzr.net/2013/05/the-google-apps-bloggeradmin-password.html
http://productforums.google.com/forum/#!topic/apps/9LXQau2yQzo

Friday, September 13, 2013

Windows Server Update Services 3.0 SP2. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.


Open cmd in "Run as administrator" mode and type
lodctr /R

Unload antivirus.

Clear SUSDB.mdf and SUSDB_log.ldf - make sure to use none-existing WSUS directory.

At the end you will receive

Restart full system.


Source:
http://social.msdn.microsoft.com/Forums/windows/en-US/09a26089-6849-4dd6-a590-714a49dda609/wsus-install-fails-there-is-a-problem-with-this-windows-installer-package

Wednesday, September 11, 2013

Force to open .jpg in Windows Picture and Fax Viewer, Windows XP/2003

On Windows XP or Windows 2003 if use Office 2002/XP then it overwrites jpg extension to open in Microsoft Photo Editor.
If you have to open like 2 Mb jpg files then it can hang out like

To overwrite default .jpg application from Microsoft Photo Editor to Windows Picture and Fax Viewer use:
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\OpenWithList" /v Application /t REG_SZ /d shimgvw.dll /f

Tuesday, September 10, 2013

Query status of Remote Desktop Access on local machine, command line

fDenyTSConnections key in registry is responsible about "turn on" or "turn off" remote desktop access on local machine.
0 - remote desktop is alowed
1 - remote desktop is not alowed

The UserAuthentication key in registry is responsible about security.
1 then secured mode is on.
0 then unsecured mode is on.



extract sed in directory where the bach file will have a good time:
@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set ts=HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server
set sub=HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server

for /f %%a in ('^
reg query "%ts%" /v fDenyTSConnections ^|
sed "s/%sub%\|fDenyTSConnections\|REG_DWORD\|0x//g" ^|
sed "s/^[ \t]*//g"') do (

if %%a==0 (
echo Terminal Server enabled

for /f %%b in ('^
reg query "%ts%\WinStations\RDP-Tcp" /v UserAuthentication ^|
sed "s/%sub%\\WinStations\\RDP-Tcp\|UserAuthentication\|REG_DWORD\|0x//g" ^|
sed "s/^[ \t]*//g"') do (
if %%b==1 echo More secured connection enabled
if %%b==0 (
echo Less secured connection enabled.
echo Any version of Remote Desktop Clients are allowed.
)
)
) else echo Terminal Server Disabled
)

endlocal
pause

Or directly save "less secure" status to log file - set l=
@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set ts=HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server
set sub=HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server
set l=%~dp0\%computername%.log

for /f %%a in ('^
reg query "%ts%" /v fDenyTSConnections ^|
sed "s/%sub%\|fDenyTSConnections\|REG_DWORD\|0x//g" ^|
sed "s/^[ \t]*//g"') do (

if %%a==0 (
echo Terminal Server enabled

for /f %%b in ('^
reg query "%ts%\WinStations\RDP-Tcp" /v UserAuthentication ^|
sed "s/%sub%\\WinStations\\RDP-Tcp\|UserAuthentication\|REG_DWORD\|0x//g" ^|
sed "s/^[ \t]*//g"') do (
if %%b==1 echo More secured connection enabled
if %%b==0 (
echo Less secured connection enabled.>"%l%"
echo Any version of Remote Desktop Clients are allowed.>>"%l%"
)
)
) else echo Terminal Server Disabled
)

endlocal

Blog Archive