sysprep interview questions
Top sysprep frequently asked interview questions
If I am going to roll out a fleet of web and app servers in AWS EC2, and none of them will be joining our domain, nor will they have any interaction with Active Directory, do I need to sysprep them? What possible issues could I face by skipping sysprep on these particular instances?
Source: (StackOverflow)
How can you provide the password to ssoconfig.exe -restoresecret
as parameter?
I'm trying to use the sysprep scripts from Colin Meade on TechNet
Checked on MSDN and ssoconfig -restoresecret
only has <restore file>
as a parameter ... no reference to "password"
Yet when I run the command, I get the prompt for a password, along with the password hint!
Source: (StackOverflow)
I have three files:
test.vbs
Set objFileSystem = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
st = ""
windir = objShell.ExpandEnvironmentStrings("%windir%")
stCommand = windir & "\System32\sysprep\sysprep.exe"
CheckFile
progx86 = objShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%")
stCommand = progx86 & "\Internet Explorer\iexplore.exe"
CheckFile
MsgBox st
Sub CheckFile
st = st & "File for test: " & stCommand & vbcrlf
If objFileSystem.FileExists(stCommand) Then
st = st & "********** File exists!!!!!"
Else
st = st & "********** I cannot find the file :-("
End If
st = st & vbcrlf & vbcrlf & vbcrlf
'objShell.Run chr(34) & stCommand & chr(34),,True
End Sub
MyTEST1.hta
<html>
<head>
<title>Test HTA</title>
<HTA:APPLICATION
APPLICATIONNAME="My TEST"
SCROLL="no"
VERSION="1.0"/>
</head>
<script type="text/vbscript">
Sub Window_OnLoad
Set oShell = Createobject("WScript.Shell")
oShell.Run "test.vbs",,True
Self.Close
End Sub
</script>
<body>
<b>My TEST</b>
</body>
</html>
MyTEST2.vbs
Set oShell = Createobject("WScript.Shell")
oShell.Run "test.vbs",,True
I launch the files on the newly installed Windows 7.
Execution of MyTEST2.vbs gives predictable result:
MyTEST2.vbs: FileExists works good for both applications IExplore.exe and Sysprep.exe
But execution of MyTEST1.hta produces different result:
MyTEST1.hta: FileExists fails on Sysprep.exe
Can anyone explain what the reason for this difference? My goal is to call Sysprep.exe from VBScript which in turn would be called from HTA. I'm stuck with it and I'd appreciate any your help.
Many thanks in advance!
Source: (StackOverflow)
azure-virtual-machine
Hello,
I am moving a bunch of servers from my datacentre to azure. Servers are test & development sharepoint & SQL. depending on how successful the migration is we will consider moving additional servers.
for this i have setup a site-to-site VPN which works as expected and is accessible from
next i followed instructions on the website, sysprep'ed the sharepoint & SQL servers, uploaded & created VMs of the 2 servers.
once assigned the new IP addresses, the servers have been facing various problems & 2 days later i am yet to get the services started.
Question:
1) relative to SQL & Sharepoint services, is sysprep recommended ? if yes, what all does sysprep knock off & would have to be re-configured on the migrated VM ?
note: i don't have a need to create multiple servers of this VM. just one move the servers from my datacentre to azure.
2) what are the implications of uploading the VHD without doing a sysprep ? what would break ? ( i know i would have to reconfigure the D: drive )
TIA.
S
Source: (StackOverflow)
I have two PowerShell scripts I'm building for a Windows 7 image. Prior to the image I run PRE-IMAGE.ps1
, and it has a line like this in it:
$JoinDomainPassword = Read-Host -Prompt "Please enter the password for $joinDomainUser" -AsSecureString
$strPass = $joinDomainPassword | ConvertFrom-SecureString
I then save the the $strPass
secure string to the registry, and run sysprep.
After a reboot with sysprep, the POST-IMAGE.ps1
then pulls $strPass
from the registry, and has a line like this:
$strPass = $strPass | ConvertTo-SecureString
$credentials = New-Object System.Management.Automation.PSCredential ($JoinDomainUser, $strPass)
However, these lines in POST-IMAGE.ps1
get the "Key not valid" error you'll see when you run convertto-securestring
and convertfrom-securestring
as different Windows users. (similiar to this question) - but the catch here is I -AM- using the same user to convert to and from secure strings. I'm guessing this has something to do with sysprep - but I can't wrap my head around it.
I apologize if this has been asked about before, I've found a few questions that touch on parts of this, but don't describe my EXACT problem.
Source: (StackOverflow)
Windows limits you to resetting Windows Product Activation up to 3 times using sysprep.
I've been asked whether the value that represents the amount of rearms left can be found in the registry.
So, after a brief research I found out that there are a couple of values stored in the registry which are somehow related to sysprep (CleaupState and GeneralizationState at HKEY_LOCAL_MACHINE/SYSTEM/Setup/Status/SysprepStatus). However, I was unable to find information as to where the counter value itself is stored. I assumed that these values are somehow used to calculate the amount of possible rearms, but I need a definite answer.
Thanks in advance!
Source: (StackOverflow)
I have an on prem sysprepped vhd with which I am trying to create a vm in azure. I am running into all kinds of errors and I am solving one after the other. Now, I actually have an error which is not making any sense to me.
New-AzureRmVM : Long running operation failed with status 'Failed'.
StartTime: 4/10/2016 11:26:53 PM
EndTime: 4/10/2016 11:34:19 PM
OperationID: cf8fee0a-4f7b-4c85-8522-c0b47147eee8
Status: Failed
ErrorCode: NetworkingInternalOperationError
ErrorMessage: Unknown network allocation error.
At line:43 char:11
+ $result = New-AzureRmVM -ResourceGroupName $resourceGroupName -Location $locatio ...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmVM], ComputeCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand
Any kind of help is apreciated and thanks in advance
Source: (StackOverflow)
I understand how to set an OS hostname in CloudInit for a Linux VM using the Python SDK like below, but how would I do the same thing for setting an OS hostname in a Windows VM using Sysprep? I can’t find any examples of this anywhere.
action = params.Action(
vm=params.VM(
initialization=params.Initialization(
cloud_init=params.CloudInit(
host=params.Host(address="rheltest001.example.com")
)
)
)
)
vm.start( action )
Source: (StackOverflow)
We have created a new custom AMI and followed the documentation here. When we launch an instance from our custom AMI we have to wait up to an hour for the instance to become usable.
The system logs look like this:
2015/05/11 10:10:16Z: Windows is being configured...
2015/05/11 10:11:17Z: Windows is still being configured...
2015/05/11 10:12:18Z: Windows is still being configured...
2015/05/11 10:13:19Z: Windows is still being configured...
2015/05/11 10:40:48Z: Windows is being configured...
2015/05/11 10:09:55Z: Message: Sysprep Start
2015/05/11 10:13:30Z: Message: Sysprep End
2015/05/11 10:41:00Z: AMI Origin Version: 2014.10.15
2015/05/11 10:41:00Z: AMI Origin Name: Windows_Server-2012-R2_RTM-English-64Bit-Base
2015/05/11 10:41:00Z: OS: Microsoft Windows NT 6.2.9200.0
2015/05/11 10:41:00Z: Language: en-US
2015/05/11 10:41:00Z: EC2 Agent: Ec2Config service v2.2.10.221
2015/05/11 10:41:03Z: Driver: AWS PV Network Device v7.2.4.1
2015/05/11 10:41:03Z: Driver: AWS PV Storage Host Adapter v7.2.4.1
2015/05/11 10:41:03Z: Message: Waiting for meta-data accessibility...
2015/05/11 10:41:03Z: Message: Meta-data is now available.
2015/05/11 10:41:04Z: AMI-ID: ami-63cda614
2015/05/11 10:41:04Z: Instance-ID: i-f1ccc516
2015/05/11 10:41:04Z: Ec2SetPassword: Enabled
2015/05/11 10:41:06Z: Username: Administrator
2015/05/11 10:41:06Z: Password: <Password>password</Password>
2015/05/11 10:41:08Z: RDPCERTIFICATE-SUBJECTNAME: WIN-BNUAEECNDU8
2015/05/11 10:41:08Z: RDPCERTIFICATE-THUMBPRINT: yudgiqwy
2015/05/11 10:42:15Z: Message: Product activation was successful
2015/05/11 10:42:15Z: Message: Ec2Config Service is rebooting the instance. Please be patient.
2015/05/11 10:47:19Z: AMI Origin Version: 2014.10.15
2015/05/11 10:47:19Z: AMI Origin Name: Windows_Server-2012-R2_RTM-English-64Bit-Base
2015/05/11 10:47:19Z: OS: Microsoft Windows NT 6.2.9200.0
2015/05/11 10:47:19Z: Language: en-US
2015/05/11 10:47:19Z: EC2 Agent: Ec2Config service v2.2.10.221
2015/05/11 10:47:19Z: Driver: AWS PV Network Device v7.2.4.1
2015/05/11 10:47:19Z: Driver: AWS PV Storage Host Adapter v7.2.4.1
2015/05/11 10:47:20Z: Message: Waiting for meta-data accessibility...
2015/05/11 10:47:20Z: Message: Meta-data is now available.
2015/05/11 10:47:20Z: AMI-ID: ami-63cda614
2015/05/11 10:47:20Z: Instance-ID: i-f1ccc516
2015/05/11 10:47:20Z: Ec2SetPassword: Disabled
2015/05/11 10:47:20Z: RDPCERTIFICATE-SUBJECTNAME: IP-C0A8E110
2015/05/11 10:47:20Z: RDPCERTIFICATE-THUMBPRINT: aidsgiusdas
2015/05/11 10:47:22Z: Message: Windows is Ready to use
As you can see on this occasion the build took nearly 40 minutes (and the instance failed to join the domain but thats a seperate issue)
Does anyone have any ideas what might be going on here? We are guessing that Sysprep is to blame but cannot verify this.
Source: (StackOverflow)
How could I launch sysprep.exe with specific arguments from my c# program ?
public void cmdPrint(string[] strcommmand)
{
Process cmd = new Process();
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.UseShellExecute = false;
cmd.Start();
cmd.StandardInput.WriteLine("cd c:\\");
foreach (string str in strcommmand)
{
cmd.StandardInput.WriteLine(str);
}
cmd.StandardInput.Flush();
cmd.StandardInput.Close();
writeLine(cmd.StandardOutput.ReadToEnd());
}
and I call it from my Windows Form Application,
string[] cmd = { "cd C:\\Windows\\System32\\Sysprep", "sysprep.exe /audit /reboot"};
consoleBox1.cmdPrint(cmd);
But it doesn't seem to start the sysprep.exe. I pasted the two commands in a .bat and launched it with,
System.Diagnostics.Process.Start(Application.StartupPath + "\\awesome.bat");
but it doesn't work either (opens a black window and closes immediately)
Running the bat file from explorer works, so i guess I am missing some permission in my c# application.
In my app.manifest,
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Is it possible to launch sysprep ? My application is made to run on Windows 7,8,8.1 and 10 on the normal desktop and on audit mode.
EDIT:
I tried the code without fulshing and closing the cmd but the program went to not responding
var procInfo = new
ProcessStartInfo("C:\\Windows\\System32\\Sysprep\\sysprep.exe");
procInfo.Arguments = "/audit /reboot";
var proc = new Process();
proc.StartInfo = procInfo;
proc.Start(); //Actually executes the process
proc.WaitForExit();
Gives error :
The system cannot find the file
specified/nSystem.ComponentModel.Win32Exception (0x80004005): The
system cannot find the file specified at
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
startInfo) at System.Diagnostics.Process.Start() at
Windows_SSD_Optimizer_Method_1.Method1.btn_all_Click(Object sender,
EventArgs e) in :line 182/n/nThe system cannot find the
file specified/nSystem.ComponentModel.Win32Exception (0x80004005): The
system cannot find the file specified at
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
startInfo) at System.Diagnostics.Process.Start() at
Windows_SSD_Optimizer_Method_1.Method1.btn_all_Click(Object sender,
EventArgs e) in :line 182/n/n
http://i.stack.imgur.com/0Em8O.png
Source: (StackOverflow)
I'm using this brief unattended.xml file ive written to be used with sysprep, and although the basics are quite obvious, i think there's an issue with either the layout, headings, or maybe even the settings pass, anyone have any ideas?
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<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">
<OOBE>
<InputLocale>0452:00000452</InputLocale>
<SystemLocale>en-GB</SystemLocale>
<UILanguage>en-GB</UILanguage>
<UserLocale>en-GB</UserLocale>
<HideEULAPage>true</HideEULAPage>
<NetworkLocation>Other</NetworkLocation>
<ProtectYourPC>1</ProtectYourPC>
<TimeZone>GMT Standard Time</TimeZone>
<SkipUserOOBE>true</SkipUserOOBE>
</OOBE>
</component>
</settings>
</unattend>
Source: (StackOverflow)
I'm trying to create a script that will automate the sysprep process but I'm running into issues with the reg add command. I keep getting Invalid Syntax even though everything looks correct according to the reg add /? command.
Here's the script:
reg add HKLM\SYSTEM\Setup\Status\Sysprepstatus /v CleanupState /t REG_DWORD /d 00000002
reg add HKLM\SYSTEM\Setup\Status\Sysprepstatus /v GeneralizationState /t REG_DWORD /d 00000007
reg add HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform /v SkipRearm /t REG_DWORD /d 00000001
msdtc -uninstall
timeout 120
msdtc -install
timeout 120
"C:\Windows\System32\Sysprep.exe" /oobe /generalize /shutdown
Any help would be appreciated. Thanks in advance!
Source: (StackOverflow)
I am working on an image, and every time I run sysprep with generalize, the resultant image will give me the error: "windows setup could not configure windows on this computer’s hardware". This dialogue box pops up when Windows is starting services. This happens no matter what I put in my answer file. It even happened when I did not have an answer file! I have looked online, and most fixes are for people who just want to get into the OOBE, which is not my goal. Any insight would be helpful.
Source: (StackOverflow)
"The domain join cannot be completed because the SID of the domain you attempted to join was identical to the SID of this machine. This is a symptom of an improperly cloned operating system install. You should run sysprep on this machine in order to generate a new machine SID."
I want to be able to change the SID of the machine without running sysprep. I have already run SIDCHG64 utility. It gives a key for only one month. I need some other solution. Any help would be appreciated.
Source: (StackOverflow)