Many moons ago a wrote a little powershell that ran only on first startup which
grabbed the data and updated the windows box and rebooted it. You have to set
the security to allow it to run, the script sets it back to default...
(please don’t judge me).
$DHCP= (ipconfig /all | findstr /C:"DHCP Server").split()[-1]
$DNSSUFFDATA=Get-WmiObject -class "Win32_NetworkAdapterConfiguration" | Where
{$_.DNSDomain -notlike ""} | Select-Object DNSDomain
$DNSSUFF=$DNSSUFFDATA.DNSDomain
$NEWHOSTNAME = Invoke-WebRequest -URI
http://$DHCP/latest/meta-data/local-hostname -UseBasicParsing
Rename-Computer -NewName $NEWHOSTNAME -Force
netdom computername $NEWHOSTNAME /Add:$NEWHOSTNAME.$DNSSUFF
netdom computername $NEWHOSTNAME /MakePrimary:$NEWHOSTNAME.$DNSSUFF
set-ExecutionPolicy -ExecutionPolicy Restricted -scope CurrentUser
Restart-Computer
[email protected]
www.shapeblue.com
53 Chandos Place, Covent Garden, London WC2N 4HSUK
@shapeblue
-----Original Message-----
From: Andrija Panic <[email protected]>
Sent: 27 July 2018 20:22
To: users <[email protected]>
Subject: Re: Windows Server 2016 Templates for Cloudstack
We are using original one (cloud instance manager) sucessfully - at least on
older template (from say 8 months ago...) - not sure if versions have been
changing or not - here is what we use (version check)
https://snag.gy/prZTPB.jpg so you can try ti compare... Unless some new mega
security by MS to ban setting pass....(I guess you confirmed the service is
running, after install ?)
Though, hostname is not set indeed - it's random windows style...
On Fri, 27 Jul 2018 at 16:48, <[email protected]> wrote:
> Thank you, I’ll look into it.
>
>
> Simon Völker
> Fraunhofer-Gesellschaft e.V.
> Abteilung C7 Kommunikationsmanagement
> Schloss Birlinghoven IZB, 53754 Sankt Augustin
> Telefon: (02241) 14-2311
> E-mail: [email protected]<mailto:
> [email protected]>
>
>
>
> Am 27.07.2018 um 11:09 schrieb Dag Sonstebo
> <[email protected]
> <mailto:[email protected]>>:
>
> Hi Simon,
>
> With regards to hostname this should just be a question of setting
> your Windows template to pick up hostname from DHCP.
>
> Admin passwords – if the existing install doesn’t work you could look
> at a cloud-init derivative for Windows, looks like
> https://cloudbase.it/cloudbase-init/ may do the trick?
>
> Regards,
> Dag Sonstebo
> Cloud Architect
> ShapeBlue
>
> On 27/07/2018, 09:53, "[email protected]<mailto:
> [email protected]>" <[email protected]<mailto:
> [email protected]>> wrote:
>
> Hi,
>
> we are currently updating templates we provide to our customers.
> However, we are running into problems with Windows Server 2016 and the
> cloudstack functionality of setting an administrator password and a
> hostname. The CloudInstanceManager we used for older versions does not
> seem to work anymore. Does anybody know a successor to the Cloud
> Instance Manager or a workaround to make the functions work in Server 2016?
>
> Regards
>
> Simon Völker
> Fraunhofer-Gesellschaft e.V.
> Abteilung C7 Kommunikationsmanagement
> Schloss Birlinghoven IZB, 53754 Sankt Augustin
> Telefon: (02241) 14-2311
> E-mail: [email protected]<mailto:
> [email protected]><mailto:[email protected]>
>
>
>
>
>
>
> [email protected]<mailto:[email protected]>
> www.shapeblue.com<http://www.shapeblue.com>
> 53 Chandos Place, Covent Garden, London WC2N 4HSUK @shapeblue
>
>
>
>
>
--
Andrija Panić