标签: windows-server-2012

获取创建日期大于某个日期时间的文件列表

我有一个日期,2015/05/28我想按创建日期顺序列出所有文件,其创建日期大于使用 PowerShell 的创建日期。我怎么能这么做呢?

我用谷歌搜索它,发现Get-ChildItem "C:\Users\gerhardl\Documents\My Received Files"但不知道如何将它与创建日期进行比较,并按创建日期对结果进行排序。

powershell windows-server-2012

4
推荐指数
1
解决办法
1万
查看次数

AWS 上的 Windows Server 2012 上的虚拟监视器或显示

我正在使用在 Amazon Web 服务 (AWS) 上运行 Windows Server 2012 R2 Base 的虚拟专用服务器 (VPS)

我正在使用Python图像库和win32api来模拟鼠标点击并截取屏幕截图。

我希望即使在未连接远程桌面的情况下也能够执行此操作。

一旦我断开连接,就没有可用的监视器,并且我的 python 程序停止,因为它无法单击任何地方(没有可单击的屏幕)

有没有办法为我的 VPS 设置一个“假”监视器或显示器,以便它可以继续愉快地点击?

python vps amazon-web-services windows-server-2012

4
推荐指数
1
解决办法
2697
查看次数

在 Win2012 上通过 Powershell 安装 Windows 服务 - 拒绝访问

我正在运行以下命令,但无法弄清楚为什么在调用 New-Service 时访问被拒绝:

param(
    [string]$serviceName,
    [string]$exePath,
    [string]$username,
    [string]$password
)

"Attempting to install service '$serviceName' - '$exePath'"
$secpassword = convertto-securestring -String $password -AsPlainText -Force  

$cred = New-Object System.Management.Automation.PSCredential($username, $secpassword)

$existingService = Get-WmiObject -Class Win32_Service -Filter "Name='$serviceName'"

if ($existingService) 
{
  "'$serviceName' exists already. Stopping."
  Stop-Service $serviceName
  "Waiting 3 seconds to allow existing service to stop."
  Start-Sleep -s 3

  $existingService.Delete()
  "Waiting 5 seconds to allow service to be un-installed."
  Start-Sleep -s 5  
}

"Installing the service."
New-Service -BinaryPathName $exePath -Name $serviceName -Credential $cred …
Run Code Online (Sandbox Code Playgroud)

powershell windows-server-2012

4
推荐指数
1
解决办法
3021
查看次数

从快照创建的 Windows Server 2012 VM 无法在 GCE 上启动

我不是 Windows 专家,在从 Snapshot 恢复 Windows Server 2012 时卡住了。我正在尝试从几周前从 Windows Server 2012 VM 实例创建的快照在 Google Compute Engine-GCE 上创建一个新的 VM 实例。每当我创建一个新的 VM 时,我永远无法执行 RDP,然后在阅读 GCE 故障排除指南后,我确定可能是 Windows 没有正确启动。我能够查看串行端口输出如下

SeaBIOS (version 1.8.2-20161003_105447-google)
Total RAM Size = 0x00000003c0000000 = 15360 MiB
CPUs found: 4     Max CPUs supported: 4
found virtio-scsi at 0:3
virtio-scsi vendor='Google' product='PersistentDisk' rev='1' type=0 removable=0
virtio-scsi blksize=512 sectors=314572800 = 153600 MiB
drive 0x000f3120: PCHS=0/0/0 translation=lba LCHS=1024/255/63 s=314572800
Booting from Hard Disk 0...
Run Code Online (Sandbox Code Playgroud)

它卡在从硬盘 0 启动...

我进一步深入研究并阅读串行端口 2 日志如下

Windows …
Run Code Online (Sandbox Code Playgroud)

google-compute-engine windows-server-2012

4
推荐指数
1
解决办法
1168
查看次数

没有www,网站不起作用

我是第一次在iis8上工作,但我的网站是php,但我不认为这个问题是在php中,因为:

如果我输入:http://mywebsite.com/image.jpg 它不会加载图像,只是超时页面.

但如果我输入:http://www.mywebsite.com/image.jpg 它运作正常.

另外,我可以ping mywebsite.com而不是www.mywebsite.com

答案可能很简单,所以请不要给我负面投票:)

iis iis-8 windows-server-2012

3
推荐指数
2
解决办法
4605
查看次数

卸载服务时出现问题?

我正在尝试卸载最近安装的服务,我在命令行中运行它:

c:\Windows\Microsoft.NET\Framework\v4.0.30319>installutil.exe /u "C:\inetpub\www
root\xxx\xxx\xxx.exe"
Run Code Online (Sandbox Code Playgroud)

但是我得到了这个:

The uninstall has completed.
An exception occurred while uninstalling. This exception will be ignored and the
 uninstall will continue. However, the application might not be fully uninstalle
d after the uninstall is complete.
Run Code Online (Sandbox Code Playgroud)

还有这个:

Removing EventLog source xxx.
An exception occurred during the uninstallation of the System.Diagnostics.EventL
ogInstaller installer.
System.Security.SecurityException: Requested registry access is not allowed.
An exception occurred while uninstalling. This exception will be ignored and the
 uninstall will continue. However, the application …
Run Code Online (Sandbox Code Playgroud)

service windows-server-2012

3
推荐指数
1
解决办法
2975
查看次数

用户注销时Xampp关闭

我在Windows Server 2012上安装了Xampp.它运行良好,但是当我注销计算机(不关闭)时,Xampp关闭,域无法访问Internet

我怎么能解决这个问题,我希望Apache和MySQL服务即使在我注销时也能继续运行

xampp windows-server-2012

3
推荐指数
1
解决办法
3961
查看次数

从Windows Server中的URL中删除.html扩展名

我在GoDaddy上有一个网站,我刚刚意识到他们使用的是Windows服务器,而不是Apache.这意味着使用.htaccess文件不起作用.

我想从所有网站网址中删除.html和.php扩展程序.

基本上,问题是:如何为Windows Server重写(在.htaccess文件中)?

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
Run Code Online (Sandbox Code Playgroud)

web-hosting iis-8 windows-server-2012

3
推荐指数
1
解决办法
6610
查看次数

退出PowerShell脚本后,通过New-PSDrive映射的网络驱动器消失

我已经尝试过寻找几天没有运气的答案......

我有一个powershell(v3.0)脚本,它检查网络驱动器并映射它(如果它尚未映射).脚本本身可以正常工作,在脚本执行期间映射并可访问驱动器,但是当脚本结束时,映射的驱动器将断开连接.我正在使用-Persist选项,它应该保留驱动器映射.

如果我从PowerShell提示符运行相同的命令,则即使退出PowerShell提示,驱动器也会映射并保持映射状态.

示例代码如下

# Drive letter to map to
$destinationDriveLetter = "G"
# Username to map the network drive
$userName = "username"
# Password to use when mapping
$userPass = ConvertTo-SecureString "password" -AsPlainText -Force

#check if Drive is already mapped
if ( Test-Path -LiteralPath $destinationDriveLetter":" -ErrorVariable errVar ) {
    Write-Host "Drive already mapped.`r`n"
    Write-Host "Exiting script`r`n"
    exit
}

Write-Host "Destination Driveletter $destinationDriveLetter not mapped. Doing it...`r`n"

$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $userName, $userPass
Write-Debug "Command: New-PSDrive -Persist -Name …
Run Code Online (Sandbox Code Playgroud)

powershell drive-mapping windows-server-2012

3
推荐指数
2
解决办法
8184
查看次数

在Windows Server 2012上为客户端禁用cmd和PowerShell

我正在使用Windows Server 2012,并且想为客户端禁用cmd和PowerShell。我已经在“组策略”中进行搜索,但是找不到在哪里可以执行此操作。请有人可以帮我吗?

cmd clients policies windows-server-2012 server

3
推荐指数
1
解决办法
4万
查看次数